.oi-workspace {
  position: fixed; inset: 0; z-index: 15000; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; min-width: 760px;
  background: #f4f6f8; color: #1f2937; font: 14px/1.45 "Meiryo", sans-serif;
}
.oi-workspace, .oi-workspace * { box-sizing: border-box; }
.oi-header, .oi-footer { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: #fff; }
.oi-header { border-bottom: 1px solid #d7dde5; justify-content: space-between; }
.oi-header h1 { margin: 0; font-size: 21px; color: #24354a; }
.oi-footer { border-top: 1px solid #d7dde5; justify-content: flex-end; }
.oi-status { margin-right: auto; font-size: 13px; }
.oi-workspace button { border: 1px solid #bbc6d2; border-radius: 5px; background: #fff; color: #263b51; padding: 8px 18px; cursor: pointer; font: inherit; }
.oi-workspace button.oi-primary { background: #285c83; border-color: #285c83; color: white; }
.oi-workspace button:disabled { opacity: .55; cursor: wait; }
.oi-workspace button:focus-visible, .oi-workspace input:focus-visible, .oi-workspace textarea:focus-visible { outline: 2px solid #3173a5; outline-offset: 2px; }
.oi-columns { display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 60%); min-height: 0; }
.oi-inputs { overflow: auto; padding: 16px clamp(14px, 2vw, 28px) 24px; min-width: 0; }
.oi-form { border: 0; padding: 0; margin: 0; min-width: 0; }
.oi-section { margin: 0 0 20px; }
.oi-section h2 { font-size: 15px; margin: 0 0 10px; padding-bottom: 7px; border-bottom: 1px solid #ccd5df; }
.oi-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.oi-field { min-width: 0; }
.oi-field-wide { grid-column: 1 / -1; }
.oi-field label, .oi-payment legend { display: block; margin-bottom: 4px; font-size: 12px; color: #445367; }
.oi-workspace input:not([type=radio]), .oi-workspace textarea { width: 100%; min-width: 0; border: 1px solid #b6c2cf; border-radius: 4px; padding: 7px 9px; font: 14px/1.4 "Meiryo", sans-serif; background: white; color: #1c2e40; }
.oi-workspace input[readonly] { background: #e9eef3; border-color: #d4dce5; }
.oi-workspace textarea { resize: vertical; min-height: 70px; }
.oi-field-state { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: #5c6877; min-height: 25px; }
.oi-field-state button { font-size: 11px; padding: 2px 5px; border: 0; text-decoration: underline; background: transparent; }
.oi-payment { min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid #d2dbe5; border-radius: 4px; }
.oi-payment label { display: inline-flex; align-items: center; gap: 4px; margin: 4px 12px 4px 0; font-size: 13px; white-space: nowrap; }
.oi-payment input { margin: 0; }
.oi-warnings, .oi-error { padding: 9px 12px; margin-bottom: 12px; background: #fff5df; border-left: 3px solid #bd8520; font-size: 12px; white-space: pre-line; }
.oi-error { background: #fff0f0; color: #963030; border-color: #ba4343; }
.oi-error:empty, .oi-warnings:empty { display: none; }
.oi-info { margin-bottom: 12px; padding: 9px 12px; background: #edf5f8; border-left: 3px solid #367388; font-size: 12px; }
.oi-info:empty { display: none; }
.oi-preview { overflow: auto; min-width: 0; padding: 16px 20px 28px; background: #dce2e8; }
.oi-preview-label { margin: 0 0 10px; font-size: 12px; color: #445367; }
.oi-paper-stage { position: relative; margin: 0 auto 20px; }
.oi-paper { position: absolute; left: 0; top: 0; width: 210mm; height: 297mm; background: #fff; color: #000; transform-origin: top left; box-shadow: 0 2px 9px #0003; }
.oi-grid { position: absolute; font-family: "MS PGothic", "ＭＳ Ｐゴシック", "Meiryo", sans-serif; line-height: 1.05; color: #000; }
.oi-grid svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.oi-cell { position: absolute; display: flex; flex-direction: column; justify-content: center; padding: 0 1.2pt; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; line-height: 1.05; color: #000; }
.oi-cell-content { width: 100%; min-width: 0; }
.oi-cell-dynamic { font-size: 8pt; }
.oi-cell-overflow { outline: 1px solid #ba4343; background: #fff2f2; }
.oi-itinerary-block { position: absolute; display: flex; align-items: center; justify-content: center; padding: 1pt 2pt; text-align: center; white-space: pre; line-height: 1.15; }
.oi-trip-time { align-items: flex-start; padding-top: 2pt; }
.oi-trip-move { padding-right: 1pt; padding-left: 1pt; }
.oi-trip-identity { justify-content: flex-start; text-align: left; }
.oi-trip-note { align-items: flex-start; justify-content: flex-start; padding: 2pt 1pt 1pt; text-align: left; }
.oi-trip-note-long { background: #fff; border: .75pt solid #000; }
.oi-overflow-details { margin-top: 16px; padding: 12px; background: #fff; border: 1px solid #bd8520; }
.oi-overflow-details summary { cursor: pointer; font-weight: bold; }
.oi-overflow-details p { white-space: pre-wrap; overflow-wrap: anywhere; }
.oi-print-blocked { display: none; }
@media print {
  @page operation-instruction { size: A4 portrait; margin: 0; }
  html:has(body.oi-open), body.oi-open { height: auto !important; overflow: visible !important; }
  body.oi-open { margin: 0 !important; padding: 0 !important; background: white !important; }
  body.oi-open > :not(.oi-workspace) { display: none !important; }
  body.oi-open .oi-workspace { page: operation-instruction; position: static !important; display: block !important; min-width: 0; background: white; }
  .oi-workspace .oi-header, .oi-workspace .oi-footer, .oi-workspace .oi-inputs, .oi-workspace .oi-preview-label, .oi-workspace .oi-overflow-details { display: none !important; }
  .oi-workspace .oi-columns, .oi-workspace .oi-preview { display: block; padding: 0; margin: 0; overflow: visible; background: white; }
  .oi-workspace .oi-paper-stage { margin: 0; width: 210mm !important; height: 297mm !important; overflow: visible; break-inside: avoid; }
  .oi-workspace .oi-paper-stage + .oi-paper-stage { break-before: page; }
  .oi-workspace .oi-paper { position: relative; transform: none !important; box-shadow: none; break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .oi-workspace:not(.oi-print-ready) .oi-paper-stage { display: none !important; }
  .oi-workspace:not(.oi-print-ready) .oi-print-blocked { display: block; padding: 20mm; font: 14pt sans-serif; }
}
