:root {
  color-scheme: light;
  --navy: #001057;
  --ink: #17283e;
  --muted: #4d6179;
  --blue: #1857a9;
  --accent: #e8f1fd;
  --line: #d8e2ee;
  --quiet: #f2f6fb;
  --page: #f6f8fb;
  font-family: Inter, "Avenir Next", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:focus-visible, :is(input, textarea, select, summary, a, .paper-well):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
a { color: var(--blue); overflow-wrap: anywhere; }
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: .8rem max(1.25rem, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: white;
}
.app-bar h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.primary {
  border: 1px solid transparent;
  border-radius: .55rem;
  background: var(--navy);
  color: white;
  font-weight: 650;
  padding: .62rem .95rem;
  white-space: nowrap;
}
.primary:hover { background: #182a70; }
.primary:disabled { opacity: .65; cursor: wait; }
main { max-width: 1360px; margin: auto; padding: 1.2rem 1.25rem 1.4rem; }
.workspace { display: grid; grid-template-columns: minmax(20rem, 26rem) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.editor, .preview { border: 1px solid var(--line); border-radius: .8rem; background: white; min-width: 0; }
.tabs {
  display: grid;
  grid-template-columns: 1.12fr .8fr 1fr;
  gap: .2rem;
  padding: .45rem;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  background: transparent;
  border: 0;
  border-radius: .45rem;
  padding: .54rem .25rem;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 650;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--navy); }
.tabs button:hover:not([aria-selected="true"]) { background: var(--quiet); }
#settings {
  min-height: 34rem;
  max-height: max(34rem, calc(100dvh - 10.25rem));
  overflow: auto;
  padding: 1.2rem;
}
.app-bar h1, #settings h2, .preview-toolbar h2 { color: var(--navy); }
#settings h2 { font-size: 1.22rem; margin: 0 0 .25rem; letter-spacing: -.025em; }
.hint { color: var(--muted); margin: 0 0 1.1rem; font-size: .91rem; }
.control { display: grid; align-content: start; gap: .28rem; margin-bottom: .85rem; font-size: .93rem; font-weight: 650; }
.control small { font-weight: 400; color: var(--muted); }
:is(.control input, .control select, .control textarea, .preview-toolbar select, .search) {
  width: 100%;
  border: 1px solid #b5c6d9;
  padding: .56rem .66rem;
  border-radius: .45rem;
  background-color: white;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}
select {
  appearance: none;
  padding-right: 2rem !important;
  background-image: linear-gradient(45deg, transparent 50%, #48627e 50%), linear-gradient(135deg, #48627e 50%, transparent 50%);
  background-position: right 1rem center, right .72rem center;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 5rem; }
.control input::placeholder, .control textarea::placeholder, .search::placeholder { color: #647890; }
.chip { color: var(--blue); background: var(--accent); border-radius: .32rem; padding: .12rem .38rem; font-weight: 650; font-size: .78rem; }
details { border-top: 1px solid var(--line); margin: .62rem 0 0; padding: .65rem 0 .14rem; }
summary { font-weight: 650; }
details > .control:first-of-type { margin-top: .7rem; }
.check-item { display: flex; gap: .55rem; align-items: flex-start; padding: .36rem 0; font-size: .94rem; }
input[type=checkbox] { width: 1rem; height: 1rem; margin: .24rem 0 0; accent-color: var(--blue); flex: none; }
.field-top { display: flex; justify-content: space-between; gap: .45rem; align-items: center; margin: .65rem 0 .25rem; }
.field-count { font-size: .86rem; color: var(--muted); }
.field-row { padding: .5rem .05rem; border-bottom: 1px solid #e6edf5; }
.field-main { display: grid; gap: .14rem; min-width: 0; flex: 1; }
.field-main strong { font-weight: 650; }
.field-main small { color: var(--muted); overflow-wrap: anywhere; line-height: 1.42; }
.field-row .control { margin: .45rem 0 .3rem; }
.field-controls { display: grid; grid-template-columns: minmax(6rem, .6fr) 1fr; gap: .45rem; padding-left: 1.55rem; }
.field-actions { display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin: .65rem 0 .2rem; }
.text-button {
  border: 0;
  border-radius: .2rem;
  background: transparent;
  color: var(--blue);
  padding: .15rem 0;
  font-size: .9rem;
  font-weight: 650;
}
.text-button:hover { text-decoration: underline; }
.custom-form, .record { background: var(--quiet); margin: .7rem 0; padding: .7rem; border-radius: .5rem; }
.record .control:last-of-type { margin-bottom: .2rem; }
.panel-foot { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; justify-content: space-between; margin-top: 1.05rem; }
.secondary {
  border: 1px solid #abc4e2;
  border-radius: .45rem;
  padding: .48rem .7rem;
  background: #f1f7fe;
  color: var(--blue);
  font-size: .91rem;
  font-weight: 650;
}
.secondary:hover { background: var(--accent); }
.preview-toolbar { display: flex; gap: .65rem; align-items: center; justify-content: space-between; padding: .55rem .8rem .55rem 1rem; border-bottom: 1px solid var(--line); }
.preview-toolbar h2 { margin: 0; font-size: .98rem; font-weight: 750; }
.preview-toolbar h2::before { content: ""; width: .48rem; height: .48rem; background: #458267; display: inline-block; border-radius: 50%; margin: 0 .5rem .08rem 0; }
.preview-toolbar select { width: auto; font-size: .87rem; padding-top: .35rem; padding-bottom: .35rem; }
.paper-well {
  background: #eaf0f7;
  padding: clamp(.8rem, 3vw, 2rem);
  height: max(34rem, calc(100dvh - 10.25rem));
  overflow: auto;
  border-radius: 0 0 .75rem .75rem;
}
.paper {
  background: #fff;
  max-width: 49rem;
  margin: 0 auto;
  border: 1px solid #d4dfec;
  box-shadow: 0 .25rem 1.1rem #1f3d6512;
  min-height: 95%;
  padding: clamp(1rem, 4.1vw, 3rem);
  color: #17283e;
  font-size: .94rem;
  overflow-wrap: anywhere;
}
.paper h1 { font-size: clamp(1.65rem, 3.5vw, 2.45rem); letter-spacing: -.045em; line-height: 1.12; margin: .55rem 0 .7rem; }
.paper :is(h2, h3, h4) { color: var(--navy); }
.paper h2 { font-size: 1.45rem; letter-spacing: -.03em; margin: .35rem 0 .85rem; }
.paper h3 { font-size: 1.08rem; margin: 1.16rem 0 .4rem; }
.paper h4 { font-size: 1rem; margin: .92rem 0 .4rem; }
.paper p { margin: .35rem 0 .7rem; white-space: pre-line; }
.paper ol { padding-left: 1.3rem; margin: .3rem 0 .8rem; }
.paper li { margin-bottom: .22rem; }
.paper .chapter { margin-top: 2.05rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.paper .guide-brand { margin: 0 0 1.1rem; }
.guide-brand img { display: block; width: 120px; max-width: 100%; height: auto; }
.paper .eyebrow { color: var(--navy); font-size: .78rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.paper .subtitle { color: var(--muted); font-size: 1rem; }
.paper .note { border-left: 3px solid var(--navy); background: #edf5ff; padding: .5rem .65rem; }
.paper table { width: 100%; border-collapse: collapse; margin: .5rem 0 .85rem; font-size: .86rem; }
.paper :is(th, td) { border: 1px solid #d9e4f0; padding: .48rem .55rem; vertical-align: middle; text-align: left; white-space: pre-line; }
.paper th { background: #e8f1fc; color: var(--navy); }
.paper tr:nth-child(even) td { background: #f7fafe; }
.paper .navigation-table th,
.paper .navigation-table td.navigation-icon { background: var(--navy); color: #fff; }
.paper .navigation-table td.navigation-icon { padding: .3rem .12rem; text-align: center; }
.navigation-icon img { display: block; width: 24px; height: 24px; margin-inline: auto; }
.paper .navigation-table .navigation-label { font-weight: 700; color: var(--navy); white-space: nowrap; }
.paper .navigation-table tbody tr:nth-child(even) td:not(.navigation-icon) { background: #f7f9fc; }
.paper .placeholder { color: #5f7690; }
.notice { margin: .65rem 0 0; color: var(--muted); font-size: .94rem; min-height: 1.4rem; }
.notice[data-error="true"] { color: #a51f44; }
.visually-hidden { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  #settings { min-height: auto; max-height: 38rem; }
  .paper-well { height: min(46rem, 85vh); }
}
@media (max-width: 450px) {
  main { padding: .8rem .75rem; }
  .app-bar { padding: .65rem .75rem; gap: .55rem; }
  .app-bar h1 { font-size: .95rem; }
  .primary { font-size: .9rem; padding: .52rem .66rem; }
  .paper :is(th, td) { padding: .36rem; }
}
