:root {
  --paper-orange: #FABF8F;
  --step1: #FBD4B4;
  --step1-label: #FEF1E6;
  --difficult-head: #E5B8B7;
  --difficult-body: #F5E3E3;
  --easier-head: #B8CCE4;
  --easier-body: #E9EFF7;
  --step2: #D9D9D9;
  --gray-label: #F2F2F2;
  --accent: #C56627;
  --accent-dark: #9E4616;
  --accent-pale: #FFF5EC;
  --text: #28231F;
  --muted: #6D655F;
  --line: #D4CBC4;
  --paper: #FFFFFF;
  --background: #F7F5F3;
  --danger: #9E3D43;
  --shadow: 0 3px 12px rgba(68, 48, 35, .11);
  --tomita-blue: #009CE1;
  --tomita-green: #00A142;
  --tomita-orange: #FFA608;
  --tomita-red: #EB472D;
  --tomita-gray: #D9D9D9;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 28px rgba(55, 42, 33, .10);
}

.app-header {
  position: relative;
  background: var(--paper-orange);
  border-bottom: 1px solid #E3A97A;
}

.header-inner {
  position: relative;
  padding: 18px 64px 16px;
  text-align: center;
}

.banner-content { width: 100%; }

.app-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .01em;
}

.title-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  color: #743A16;
  background: #FFFFFF;
  border: 1px solid rgba(132, 73, 31, .20);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(132, 73, 31, .08);
  font-size: 1.32em;
  font-weight: 900;
}

.app-subtitle {
  margin-top: 8px;
  color: #674D3C;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: .055em;
}

.back-button {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(107, 55, 20, .35);
  border-radius: 50%;
  color: #6A3718;
  background: rgba(255, 255, 255, .88);
  font-size: 23px;
  font-weight: 900;
}

.step-bar { height: 5px; background: #F4D8C1; }
.step-bar span { display: block; width: 0; height: 100%; background: var(--accent-dark); transition: width .2s ease; }

main { padding: 20px 22px 42px; }

.panel {
  margin: 0 0 17px;
  padding: 20px;
  background: #FFFFFF;
  border: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -20px -20px 18px;
  padding: 12px 15px;
  color: #673616;
  background: var(--step1);
  border-bottom: 1px solid #E8B58B;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.section-title svg,
.app-info-title svg {
  width: 25px;
  height: 25px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subheading {
  margin: 22px 0 10px;
  padding: 8px 11px;
  background: var(--accent-pale);
  border-top: 1px solid #EFD7C4;
  border-bottom: 1px solid #EFD7C4;
  color: #6D3B1C;
  font-weight: 900;
}

.field { margin: 0 0 16px; }
.label { display: block; margin-bottom: 6px; font-weight: 850; }
.required { margin-left: 5px; color: #8C403C; font-size: 12px; font-weight: 850; }
.optional, .muted { color: var(--muted); font-size: 14px; }

input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid #BFB6AF;
  border-radius: 7px;
}

textarea { min-height: 105px; resize: vertical; line-height: 1.7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(197, 102, 39, .30);
  outline-offset: 2px;
}

.button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  font-weight: 850;
  transition: transform .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}

.button.primary { color: #FFFFFF; background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary { color: #713B18; background: #FFFFFF; }
.button.ghost { color: #5B514A; background: #FFFFFF; border-color: #BFB6AF; }
.button.danger { color: var(--danger); background: #FFFFFF; border-color: #C99094; }
.button.full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary:hover { background: #7F350E; }

.new-record-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 14px;
  margin-top: 13px;
}
.info-grid .key { color: #655C56; font-weight: 800; }

.setup-empty {
  padding: 14px;
  margin-bottom: 13px;
  background: #FFFDFC;
  border: 1px solid #E2D9D2;
}
.setup-empty strong { display: block; margin-bottom: 3px; font-size: 17px; }
.setup-empty p { margin: 0; color: var(--muted); font-size: 14px; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid #C8BFB8;
  border-radius: 9px;
  text-align: left;
  font-weight: 760;
  transition: .12s ease;
}

.choice .box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  color: transparent;
  border: 1.7px solid #867C75;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 900;
}

.choice.selected {
  color: #FFFFFF;
  background: var(--choice-color, var(--accent-dark));
  border-color: var(--choice-color, var(--accent-dark));
  box-shadow: var(--shadow);
  transform: scale(1.012);
}
.choice.selected .box { color: #FFFFFF; border-color: #FFFFFF; }
.choice-description { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; line-height: 1.45; opacity: .88; }

.stage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stage-choice { align-items: flex-start; min-height: 93px; }
.stage-choice strong { display: block; }
.stage-choice small { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; line-height: 1.5; opacity: .9; }
.stage-grid .pending-choice { grid-column: 1 / -1; min-height: 56px; }
.pending-choice.selected { --choice-color: #706861; }

.tomita-panel { border-color: #D7B79F; }
.tomita-intro {
  margin-bottom: 13px;
  padding: 11px 13px;
  color: #593B28;
  background: #FFF8F2;
  border-left: 4px solid var(--accent);
}
.tomita-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
  padding: 12px 13px;
  background: #FFFDFC;
  border: 1px solid var(--line);
}
.tomita-summary-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.tomita-summary-empty span { color: var(--muted); font-size: 14px; }
.tomita-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: #FFFFFF;
  border: 3px solid var(--accent);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}
.tomita-summary-label { font-size: 17px; font-weight: 900; line-height: 1.35; }
.tomita-summary-divider { width: 1px; height: 34px; background: var(--line); }
.tomita-table-wrap { width: 100%; margin-bottom: 17px; overflow: visible; }
.tomita-grid {
  display: grid;
  grid-template-columns: minmax(78px, 1.35fr) repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}
.tomita-row-head,
.tomita-column-head,
.tomita-axis-corner,
.tomita-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 4px;
  text-align: center;
}
.tomita-row-head,
.tomita-column-head {
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
}
.tomita-axis-corner { color: var(--muted); background: #F4F1EF; font-size: 9px; font-weight: 800; line-height: 1.25; }
.tomita-cell { background: var(--tomita-gray); font-size: 18px; font-weight: 800; }
.tomita-cell.active span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background: #FFFFFF;
  border: 3px solid #202421;
  border-radius: 50%;
  font-weight: 900;
}
.tomita-language, .tomita-walk { background: var(--tomita-blue); }
.tomita-proposition, .tomita-wheel { background: var(--tomita-green); }
.tomita-intent, .tomita-floor { background: var(--tomita-orange); }
.tomita-listen, .tomita-bed { background: var(--tomita-red); }
.tomita-selection-title {
  margin: 19px 0 9px;
  padding: 8px 11px;
  color: #6D3B1C;
  background: var(--accent-pale);
  border-top: 1px solid #EFD7C4;
  border-bottom: 1px solid #EFD7C4;
  font-weight: 900;
}
.tomita-record-frame { margin-bottom: 14px; padding: 12px; background: #FAF8F6; border: 1px solid var(--line); }
.tomita-record-frame .tomita-table-wrap { margin-bottom: 0; }
.assessment-meta {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr);
  gap: 12px;
  margin-top: 16px;
}
.assessment-meta .field { margin-bottom: 0; }
.assessment-note { margin-top: 11px; }
.tomita-assessment-button { margin-top: 2px; }
.tomita-flow-card {
  margin-bottom: 14px;
  padding: 18px;
  background: #FFFFFF;
  border: 1px solid var(--line);
}
.tomita-phase-head {
  margin: -18px -18px 16px;
  padding: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}
.tomita-phase-head.mobility { background: #F7AAA0; }
.tomita-phase-head.communication { background: #F9D09A; }
.tomita-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 106px;
  margin: 4px 0;
}
.tomita-symbol-sprite {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  background-image: url('/assets/symbols.webp');
  background-repeat: no-repeat;
  background-position: 0 calc(var(--symbol-index) * -104px);
  background-size: 104px 832px;
}
.tomita-symbol.compact { height: 92px; margin: 0; }
.tomita-symbol.compact .tomita-symbol-sprite { transform: scale(.82); }
.tomita-flow-question {
  padding: 8px 5px 16px;
  text-align: center;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.6;
}
.tomita-yesno {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tomita-result-hint {
  margin-top: 13px;
  padding: 10px 12px;
  color: #FFFFFF;
  background: var(--tomita-result-color);
  border-radius: 9px;
  text-align: center;
  font-weight: 850;
}
.tomita-flow-note { text-align: center; }
.tomita-outcome {
  margin-bottom: 13px;
  padding: 13px;
  color: #FFFFFF;
  background: var(--tomita-result-color);
  font-weight: 850;
}
.tomita-outcome-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.tomita-outcome-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}
.tomita-outcome-divider { width: 1px; height: 30px; background: rgba(255, 255, 255, .72); }
.tomita-transition-message { margin: 0; text-align: center; font-weight: 850; }
.tomita-result-symbol-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 14px;
}
.tomita-result-symbol-item {
  padding: 8px;
  background: #FBFCFB;
  border: 1px solid var(--line);
  text-align: center;
}
.tomita-result-symbol-label { margin-top: 2px; font-size: 13px; font-weight: 850; }
.tomita-register-button { margin-top: 14px; }
.tomita-unclassified-note {
  padding: 13px 14px;
  background: #FFF9F4;
  border: 1px solid #E9CFBC;
  border-left: 4px solid var(--accent);
  line-height: 1.7;
}

.condition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.condition-card { border: 1px solid var(--line); }
.condition-card .condition-head { padding: 10px 12px; text-align: center; font-size: 18px; font-weight: 900; }
.condition-card .condition-body { padding: 14px; }
.condition-card.difficult { --choice-color: #A5545B; }
.condition-card.difficult .condition-head { background: var(--difficult-head); }
.condition-card.difficult .condition-body { background: var(--difficult-body); }
.condition-card.easier { --choice-color: #55769D; }
.condition-card.easier .condition-head { background: var(--easier-head); }
.condition-card.easier .condition-body { background: var(--easier-body); }
.condition-card .subheading { margin-top: 17px; background: rgba(255,255,255,.58); border-color: rgba(70,60,54,.14); }
.nested-options { margin: 8px 0 0 28px; }

.domain-card { margin-bottom: 13px; border: 1px solid #C8C8C8; }
.domain-head { padding: 10px 13px; background: var(--step2); font-size: 18px; font-weight: 900; }
.domain-body { padding: 14px; }

.review-reference {
  margin-bottom: 15px;
  padding: 14px;
  background: #FAF8F6;
  border-left: 4px solid var(--accent);
}
.review-reference h3 { margin: 0 0 8px; font-size: 16px; }
.review-reference p { margin: 5px 0; }

.review-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.review-table th, .review-table td { padding: 9px 10px; border-bottom: 1px solid #DDD5CF; vertical-align: top; text-align: left; word-break: break-word; }
.review-table th { width: 190px; background: #F6F2EF; }

.draft-panel { border-left: 5px solid var(--accent); background: #FFFDFC; }
.carryover-panel { border-left: 5px solid #6B86A8; }
.carryover-grid { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; }

.history-item { padding: 13px 0; border-bottom: 1px solid #E2DCD7; }
.history-item:last-child { border-bottom: 0; }
.history-title { font-weight: 900; }
.history-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.empty { padding: 7px 0; color: var(--muted); }

.app-info-panel { padding: 0; overflow: hidden; }
.app-info-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: #673616;
  background: var(--step1);
  border-bottom: 1px solid #E8B58B;
  font-size: 20px;
  font-weight: 900;
}
.app-info-details { border-bottom: 1px solid var(--line); }
.app-info-details:last-child { border-bottom: 0; }
.app-info-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  color: #673616;
  background: #FFFFFF;
  cursor: pointer;
  list-style: none;
  font-weight: 850;
}
.app-info-details > summary::-webkit-details-marker { display: none; }
.app-info-details[open] > summary { background: #FFF8F2; border-bottom: 1px solid #EADBD0; }
.chevron { width: 10px; height: 10px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
.app-info-details[open] .chevron { transform: rotate(225deg); }
.app-info-content { padding: 0; }

.guide-inner { padding: 16px 16px 14px; }
.guide-step { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.guide-number { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-top: 2px; color: #FFFFFF; background: var(--accent-dark); border-radius: 50%; font-size: 22px; font-weight: 900; line-height: 1; }
.guide-step strong { display: block; margin: 0 0 4px; font-size: 17px; }
.guide-step p { margin: 0; font-size: 15px; line-height: 1.7; }
.guide-arrow { display: flex; align-items: center; justify-content: center; width: 40px; padding: 4px 0; color: var(--accent); font-size: 28px; font-weight: 700; line-height: 1; }
.guide-foot { margin-top: 14px; padding-top: 12px; border-top: 2px dotted #D49A70; text-align: center; font-size: 15px; }

.about-item { padding: 16px 14px; border-bottom: 1px solid #E9E1DB; }
.about-item:last-child { border-bottom: 0; }
.about-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  color: #7B4019;
  border-bottom: 1px dashed #C98B5D;
  font-size: 17px;
  font-weight: 900;
}
.about-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: none;
  color: #FFFFFF;
  background: var(--accent-dark);
  border-radius: 50%;
  font-size: 14px;
}
.about-body { font-size: 14px; line-height: 1.8; }
.about-link {
  display: inline-block;
  margin-top: 7px;
  color: #7B4019;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.about-link::after { content: ' 〉'; text-decoration: none; }
.notice, .warning {
  padding: 13px 14px;
  margin-bottom: 15px;
  background: #FFF9F4;
  border: 1px solid #E9CFBC;
}
.warning { color: #733B38; background: #FFF6F5; border-color: #DDB6B3; }

.step-label { margin-bottom: 8px; color: #6A5C52; font-size: 14px; font-weight: 850; }
.save-message { padding: 14px; margin-bottom: 15px; color: #4B2C18; background: #FFF1E5; border: 1px solid #E7B990; font-weight: 900; text-align: center; }
.paper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
  background: #FFF9F4;
  border: 1px solid #E9CFBC;
}
.paper-sheet-frame { width: 100%; overflow: hidden; background: #E8E5E2; }
.paper-sheet {
  position: relative;
  width: 595.32pt;
  height: 841.92pt;
  margin: 0 auto;
  padding: 0;
  color: #111;
  background: #FFF;
  border: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
  font-family: "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 7.2pt;
  line-height: 1.18;
  transform-origin: top left;
}
.paper-template-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 595.32pt;
  height: 841.92pt;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.paper-overlay-text,
.paper-overlay-tick {
  position: absolute;
  z-index: 2;
  color: #111;
  font-family: "UD デジタル 教科書体 N-R", "UD Digi Kyokasho N-R", "UD デジタル 教科書体 N", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
}
.paper-overlay-text {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 1.5pt;
  font-size: 7.5pt;
  font-weight: 400;
  line-height: 1.18;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.paper-overlay-small { font-size: 6.8pt; line-height: 1.05; }
.paper-overlay-trial { font-size: 6.8pt; line-height: 1.05; }
.paper-overlay-nowrap {
  white-space: nowrap;
  overflow-wrap: normal;
}
.paper-overlay-tick {
  width: 7.5pt;
  height: 7.5pt;
  background: #111;
}
.paper-sheet h1 {
  position: absolute;
  top: 38.16pt;
  left: 53.88pt;
  width: 491.26pt;
  height: 22.44pt;
  margin: 0;
  padding: 1.7pt 6pt 0;
  background: #FBBF8F;
  font-size: 16pt;
  line-height: 1.1;
  text-align: center;
}
.paper-lead, .paper-note {
  position: absolute;
  left: 53.88pt;
  width: 491.26pt;
  margin: 0;
  color: #555;
  font-size: 7.2pt;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}
.paper-lead { top: 65.8pt; }
.paper-note { top: 81.7pt; color: #707070; }
.paper-basic-grid {
  position: absolute;
  top: 105.02pt;
  left: 53.64pt;
  width: 488.14pt;
  height: 46.92pt;
  display: grid;
  grid-template-columns: 105.38pt 155.9pt 105.5pt 121.36pt;
  grid-template-rows: 23.16pt 23.76pt;
  margin: 0;
  border-top: .48pt solid #BFBFBF;
  border-left: .48pt solid #BFBFBF;
}
.paper-basic-grid > div,
.paper-grid > div {
  min-width: 0;
  min-height: 0;
  padding: 3.1pt 5.16pt;
  overflow: hidden;
  border-right: .48pt solid #BFBFBF;
  border-bottom: .48pt solid #BFBFBF;
  white-space: pre-wrap;
}
.paper-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5.16pt !important;
  background: #F2F2F2;
  font-weight: 800;
  text-align: center;
}
.paper-band {
  position: absolute;
  left: 52.08pt;
  width: 491.26pt;
  height: 22.68pt;
  display: flex;
  align-items: center;
  gap: 16pt;
  margin: 0;
  padding: 0 6.4pt;
  font-size: 10.5pt;
  line-height: 1;
}
.paper-band-orange { top: 166.94pt; background: #FBD4B4; }
.paper-band-gray { top: 479.35pt; background: #D9D9D9; }
.paper-band-blue { top: 661.9pt; left: 52.8pt; width: 489.82pt; background: #B8CCE4; }
.paper-grid { position: absolute; display: grid; border-top: .48pt solid #BFBFBF; border-left: .48pt solid #BFBFBF; }
.paper-current-grid {
  top: 189.62pt;
  left: 51.84pt;
  width: 491.74pt;
  height: 274.73pt;
  grid-template-columns: 106.58pt 193.73pt 191.43pt;
  grid-template-rows: 23.16pt 24.6pt 23.19pt 20.4pt 32.52pt 72.36pt 48.62pt 28.92pt;
}
.paper-span-2 { grid-column: span 2; }
.paper-options-row { display: flex; align-items: center; justify-content: space-between; gap: 2pt; padding: 2.6pt 6pt !important; }
.paper-communication-row { align-items: flex-start; padding-top: 2.1pt !important; }
.paper-stage-option { flex: 1 1 23%; min-width: 0; text-align: left; }
.paper-stage-option .paper-option { margin-right: 0; }
.paper-stage-detail { display: block; margin-top: 1pt; padding-left: 11pt; font-size: 6.5pt; white-space: nowrap; }
.paper-option { display: inline-flex; align-items: center; gap: 2.1pt; margin: .4pt 5pt .4pt 0; white-space: nowrap; }
.paper-check { display: inline-flex; align-items: center; justify-content: center; width: 7.5pt; height: 7.5pt; flex: none; border: .75pt solid #222; font-size: 6.2pt; font-weight: 900; line-height: 1; }
.paper-school-modes .paper-option { margin-right: 2.5pt; }
.paper-condition-head { display: flex; align-items: center; justify-content: center; padding: 0 !important; text-align: center; font-size: 9pt; }
.paper-condition-head.difficult { background: #E5B8B7; }
.paper-condition-head.easier { background: #B8CCE4; }
.paper-difficult { background: #F5E3E3; }
.paper-easier { background: #E9EFF7; }
.paper-inline-note { display: inline; }
.paper-text-line { margin-top: 1pt; }
.paper-entry-label { margin-top: 1pt; font-weight: 700; }
.paper-hint { color: #777; }
.paper-entry { min-height: 0; margin-top: 1pt; overflow: hidden; overflow-wrap: anywhere; }
.paper-support-entry { min-height: 0; }
.paper-clues-grid {
  top: 502.03pt;
  left: 51.84pt;
  width: 491.74pt;
  height: 144.87pt;
  grid-template-columns: 106.58pt 385.16pt;
  grid-template-rows: repeat(5, 28.92pt);
}
.paper-organization-grid {
  top: 684.58pt;
  left: 52.56pt;
  width: 490.3pt;
  height: 115.46pt;
  grid-template-columns: 106.58pt 383.72pt;
  grid-template-rows: repeat(4, 28.86pt);
}
.paper-clues-grid > div:nth-child(2n),
.paper-organization-grid > div:nth-child(2n) { padding-top: 3.2pt; padding-bottom: 2.4pt; }
.paper-organization-grid .paper-entry { min-height: 0; }
.paper-footer { position: absolute; top: 813pt; right: 52.8pt; margin: 0; color: #666; text-align: right; font-size: 6.5pt; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.footer { padding: 19px 16px 25px; color: #766D67; background: #F5F2EF; border-top: 1px solid #DED7D1; text-align: center; font-size: 13px; }

@media (max-width: 760px) {
  .header-inner { padding: 14px 44px 13px; }
  .app-title { gap: 7px; flex-wrap: wrap; font-size: 18px; }
  .title-box { padding: 5px 12px; border-radius: 9px; font-size: 1.32em; }
  .app-subtitle { margin-top: 7px; font-size: 17px; letter-spacing: .04em; }
  .back-button { left: 10px; width: 38px; height: 38px; }
  main { padding: 14px 12px 34px; }
  .panel { padding: 16px 14px; }
  .section-title { margin: -16px -14px 15px; font-size: 18px; }
  .app-info-title { font-size: 18px; }
  .about-item { padding: 14px 12px; }
  .about-head { font-size: 16px; }
  .about-body { font-size: 13px; }
  .choice-grid, .stage-grid, .condition-grid, .assessment-meta { grid-template-columns: 1fr; }
  .stage-choice { min-height: 68px; }
  .tomita-grid { grid-template-columns: minmax(65px, 1.3fr) repeat(4, minmax(0, 1fr)); gap: 2px; }
  .tomita-row-head, .tomita-column-head, .tomita-axis-corner, .tomita-cell { min-height: 43px; }
  .tomita-row-head, .tomita-column-head { font-size: 9.5px; }
  .tomita-axis-corner { font-size: 7.5px; }
  .tomita-cell { font-size: 16px; }
  .tomita-cell.active span { width: 31px; height: 31px; }
  .tomita-summary-label { font-size: 14px; }
  .tomita-number { width: 38px; height: 38px; }
  .tomita-flow-question { font-size: 18px; }
  .tomita-result-symbol-pair { gap: 8px; }
  .tomita-result-symbol-item { padding: 6px; }
  .tomita-symbol.compact { height: 80px; }
  .tomita-symbol.compact .tomita-symbol-sprite { transform: scale(.72); }
  .info-grid { grid-template-columns: 105px minmax(0, 1fr); gap: 7px 10px; }
  .row-between { align-items: flex-start; }
  .review-table th { width: 112px; }
  .carryover-grid { grid-template-columns: 78px 1fr; }
  .actions .button { flex: 1 1 145px; }
  .paper-toolbar { align-items: stretch; flex-direction: column; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  @page detail-record { size: A4 portrait; margin: 5mm; }
  @page paper-sheet { size: A4 portrait; margin: 0; }
  html, body, .app { min-height: 0 !important; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; background: #FFFFFF !important; box-shadow: none !important; }
  .app-header, .footer, .no-print, .app-info-panel { display: none !important; }
  main { padding: 0 !important; }
  .panel { page: detail-record; border: 0 !important; margin: 0 !important; padding: 0 !important; }
  .section-title { margin: 0 0 4mm !important; padding: 2.5mm 3mm !important; }
  .review-table { font-size: 9pt; }
  .review-table th, .review-table td { padding: 1.4mm 1.8mm; break-inside: avoid; }
  .paper-sheet-frame { width: 595.32pt !important; height: 841.92pt !important; overflow: visible !important; background: #FFFFFF !important; }
  .paper-sheet {
    page: paper-sheet;
    width: 595.32pt !important;
    height: 841.92pt !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }
  .paper-template-image { print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
}
