@import url('./personal-manual.css');

:root {
  --ideal-blue: #244d61;
  --ideal-blue-soft: #e8f0f3;
  --ideal-gold: #9a6b2f;
  --ideal-danger: #9b3d35;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; overflow-x: clip; background: #fbf8f2; color: #142033; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, .button, input[type="checkbox"] { min-height: 44px; }
textarea { width: 100%; min-height: 132px; resize: vertical; }
input[type="text"], input[type="number"], select, textarea {
  border: 1px solid #b8c3c5;
  border-radius: 10px;
  background: #fff;
  padding: .75rem;
  color: inherit;
}
:focus-visible { outline: 3px solid #e88a55; outline-offset: 3px; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: #142033; color: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.tool-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid #e2ddd4; }
.brand-link { color: inherit; text-decoration: none; font-weight: 700; }
.storage-state { margin: 0; color: #52636b; font-size: .9rem; text-align: right; }
.intro-shell, .result-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2.5rem, 8vw, 6rem) 0; }
.intro-shell > h1, .result-heading h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.12; margin: .4rem 0 1rem; }
.eyebrow { color: var(--ideal-gold); font-weight: 800; letter-spacing: .14em; font-size: .78rem; }
.lead { font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.75; color: #42555e; }
.intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 2.5rem 0; }
.intro-grid article, .item-card, .result-section, .review-card { background: #fff; border: 1px solid #e2ddd4; border-radius: 16px; padding: 1.25rem; }
.intro-grid h2 { font-size: 1.1rem; margin-top: 0; }
.notice { border-left: 4px solid var(--ideal-gold); background: #fff7e9; padding: 1rem 1.2rem; border-radius: 0 12px 12px 0; line-height: 1.7; }
.button-row, .step-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.button { border: 1px solid #8ba0a9; background: #fff; color: #142033; border-radius: 999px; padding: .65rem 1.1rem; cursor: pointer; }
.button--primary { background: var(--ideal-blue); border-color: var(--ideal-blue); color: white; }
.button--quiet { background: transparent; }
.button--danger { color: var(--ideal-danger); border-color: #c98f89; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.form-message { min-height: 1.5rem; color: #52636b; }

.tool-shell { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); padding: 2rem 0 5rem; }
.chapter-rail { position: sticky; top: 1rem; align-self: start; }
.progress-text { font-weight: 700; }
.progress-track { height: 6px; background: #e1e7e9; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--ideal-blue); transition: width .2s ease; }
.chapter-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.chapter-list button { width: 100%; border: 0; border-left: 3px solid transparent; background: transparent; padding: .65rem .75rem; text-align: left; color: #52636b; cursor: pointer; }
.chapter-list button[aria-current="step"] { color: var(--ideal-blue); border-left-color: var(--ideal-blue); font-weight: 800; background: var(--ideal-blue-soft); }
.step-panel { min-width: 0; }
.step-panel h1 { font-size: clamp(2rem, 5vw, 3.6rem); margin: .3rem 0 1rem; }
.step-panel form { margin-top: 2rem; }
.field-stack { display: grid; gap: 1rem; }
.field-group { display: grid; gap: .5rem; }
.field-group > label, .field-label { font-weight: 800; }
.field-hint { color: #5d6c73; margin: 0; font-size: .92rem; line-height: 1.6; }
.item-list { display: grid; gap: 1rem; margin: 1rem 0; }
.item-card { display: grid; gap: .8rem; }
.item-card__header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.item-card__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.item-card__actions button { min-height: 44px; border: 1px solid #b8c3c5; background: white; border-radius: 8px; padding: .45rem .7rem; }
.salary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.salary-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.privacy-controls { display: grid; gap: .75rem; margin-top: 1.5rem; padding: 1rem; border: 2px solid #d6bd98; border-radius: 14px; background: #fffaf1; }
.check-row { display: flex; gap: .8rem; align-items: flex-start; line-height: 1.55; }
.check-row input { flex: 0 0 auto; width: 22px; margin-top: .1rem; }
.review-grid { display: grid; gap: 1rem; }
.review-card h2 { margin-top: 0; font-size: 1.2rem; }
.review-options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }

.result-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0; }
.result-tabs button { border: 1px solid #8ba0a9; background: white; border-radius: 999px; padding: .65rem 1rem; }
.result-tabs button[aria-selected="true"] { background: var(--ideal-blue); color: white; border-color: var(--ideal-blue); }
.result-content { display: grid; gap: 1rem; }
.result-section h2 { color: var(--ideal-blue); }
.result-section h3 { margin-bottom: .35rem; }
.result-section p, .result-section li { line-height: 1.75; overflow-wrap: anywhere; }
.result-disclaimer { margin-top: 2rem; }
.empty-result { padding: 2rem; text-align: center; color: #5d6c73; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20, 32, 51, .68); display: grid; place-items: center; padding: 1rem; }
.dialog-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 18px; padding: 1.5rem; position: relative; }
.dialog-close { position: absolute; right: .8rem; top: .6rem; border: 0; background: transparent; font-size: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .intro-grid { grid-template-columns: 1fr; }
  .tool-shell { grid-template-columns: 1fr; }
  .chapter-rail { position: static; }
  .chapter-list { display: flex; overflow-x: auto; padding-bottom: .5rem; }
  .chapter-list li { flex: 0 0 180px; }
  .chapter-list button { border-left: 0; border-bottom: 3px solid transparent; }
  .chapter-list button[aria-current="step"] { border-bottom-color: var(--ideal-blue); }
}

@media (max-width: 640px) {
  .tool-header { align-items: flex-start; }
  .salary-grid, .salary-meta, .review-options { grid-template-columns: 1fr; }
  .button-row .button, .step-actions .button { width: 100%; }
  .item-card__header { align-items: flex-start; flex-direction: column; }
}

@media print {
  .tool-header, .result-tabs, .result-actions, .result-disclaimer, .dialog-backdrop { display: none !important; }
  body { background: white; }
  .result-shell { width: 100%; padding: 0; }
  .result-heading h1 { font-size: 28pt; }
  .result-section { break-inside: avoid; border-color: #bbb; box-shadow: none; }
  .result-content { display: block; }
  .result-section { margin-bottom: 12pt; }
  .print-part-title { margin-top: 24pt; break-after: avoid; color: #244d61; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
