/* The online application (website/design/application): a step rail on the
   left on desktop, a progress bar on top on mobile. Builds on site.css. */

.apply { display: flex; min-height: 100vh; }

.rail {
  width: 420px; flex-shrink: 0; border-right: 1px solid var(--line);
  padding: 40px 48px; display: flex; flex-direction: column; gap: 36px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.rail .brand { gap: 12px; }
.rail .brand img { width: 26px; }
.rail .brand-words { gap: 2px; }
.rail .brand-words .wm { font-size: 11px; }
.rail-intro { display: flex; flex-direction: column; gap: 6px; }
.rail-intro .k { color: var(--ink); }
.rail-intro p { font-size: 13px; color: var(--ink-quiet); line-height: 1.6; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li {
  display: flex; align-items: center; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-quiet);
}
.steps .dot {
  width: 22px; height: 22px; border-radius: 11px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0;
}
.steps li.now { color: var(--ink); }
.steps li.now .dot { border-color: var(--ink); color: var(--ink); }
.steps li.done { color: var(--ink); }
.steps li.done .dot { border-color: var(--ink); background: var(--ink); color: var(--ground); }
body.demo .apply { min-height: calc(100vh - 36px); }
body.demo .rail { top: 36px; height: calc(100vh - 36px); }
.rail-foot { margin-top: auto; font-size: 12px; color: var(--ink-quiet); line-height: 1.6; }

.top-m { display: none; }

.stage {
  flex-grow: 1; padding: 64px 96px; display: flex; flex-direction: column; gap: 28px;
  max-width: 1020px;
}
.stage-head { display: flex; flex-direction: column; gap: 10px; }
.stage h1 { font-weight: 200; letter-spacing: -1.5px; font-size: 44px; line-height: 1.08; }
.stage-head p { font-size: 16px; line-height: 1.6; color: var(--ink-quiet); max-width: 640px; }

.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; }
.actions .link { font-size: 13px; color: var(--ink-quiet); background: none; border: 0; padding: 0; cursor: pointer; }
.actions .link:hover { color: var(--ink); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: 100%; }
.field.wide { width: 100%; max-width: 760px; }
.field label, .label { font-size: 11px; letter-spacing: 2.5px; color: var(--ink-quiet); text-transform: uppercase; }
.input {
  min-height: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px; color: var(--ink); font-family: inherit; font-size: 15px; width: 100%;
}
textarea.input { min-height: 110px; padding: 14px; line-height: 1.5; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink-quiet); }
.input[aria-invalid="true"] { border-color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-quiet); line-height: 1.5; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; }
.fields-2 .field { width: 100%; }

/* Tiles: the two-column cards with a state on the right */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; }
.tiles.full { max-width: none; }
.tile {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; border: 1px solid var(--ink); border-radius: 14px; background: transparent;
  min-height: 64px; text-align: left; width: 100%; color: var(--ink); font: inherit;
}
button.tile, label.tile { cursor: pointer; }
.tile.quiet { border-color: var(--line); background: var(--surface); }
.tile > span:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile .t { font-size: 15px; overflow-wrap: anywhere; }
.tile .s { font-size: 12.5px; color: var(--ink-quiet); }
.tile .state { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
.tile.quiet .state { color: var(--ink-quiet); }
.tile input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.note-box {
  display: flex; align-items: center; gap: 18px; max-width: 760px; padding: 18px 20px;
  border: 1px solid var(--ink); border-radius: 14px;
}
.note-box .n { font-size: 28px; font-weight: 200; }
.note-box .s { font-size: 14px; color: var(--ink-quiet); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; }
.chip {
  min-height: 44px; padding: 11px 18px; border-radius: 22px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--ground); }

/* Table-like rows: label · amount · note */
.lines { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.line {
  display: grid; grid-template-columns: 1.2fr 0.7fr 1.4fr; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line); font-size: 14.5px; align-items: baseline;
  background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--ink); text-align: left; font-family: inherit; width: 100%;
}
button.line { cursor: pointer; }
button.line:hover .amt { text-decoration: underline; text-underline-offset: 4px; }
.line .amt { font-weight: 500; }
.line .note { color: var(--ink-quiet); font-size: 13px; line-height: 1.5; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 760px; flex-wrap: wrap; }
.total { display: flex; align-items: baseline; gap: 12px; }
.total .n { font-size: 28px; font-weight: 300; }

/* An inline editor under a line */
.editor {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; margin: 10px 0 4px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); max-width: 760px;
}
.editor .row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.editor .field { width: 220px; }
.editor .input { background: var(--ground); }
.editor .btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Fee rows */
.fee-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 760px; }
.fee-row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.fee-row .t { font-size: 15px; }
.fee-row .amt { font-size: 15px; font-weight: 500; text-align: right; }
.fee-row .s { font-size: 13px; color: var(--ink-quiet); grid-column: 1 / -1; line-height: 1.5; }

/* Ticks */
.ticks { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.ticks.loose { gap: 14px; }
.tick { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.tick input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #FFFFFF; flex-shrink: 0; }
.tick span { font-size: 14.5px; line-height: 1.5; }
.small { font-size: 12.5px; color: var(--ink-quiet); line-height: 1.6; max-width: 640px; }
.small a { text-decoration: underline; text-underline-offset: 3px; }
.small a:hover { color: var(--ink); }

/* Timeline (submitted) */
.timeline { display: flex; flex-direction: column; max-width: 640px; }
.tl { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tl .b { width: 10px; height: 10px; border-radius: 5px; margin-top: 6px; flex-shrink: 0; border: 1px solid var(--line-strong); }
.tl.done .b { background: var(--ink); border-color: var(--ink); }
.tl > div { display: flex; flex-direction: column; gap: 3px; }
.tl .t { font-size: 15px; color: var(--ink-quiet); }
.tl.done .t { color: var(--ink); }
.tl .s { font-size: 13px; color: var(--ink-quiet); }

/* Messages */
.alert {
  max-width: 760px; padding: 14px 18px; border: 1px solid var(--ink); border-radius: 14px;
  font-size: 14px; line-height: 1.5;
}
.alert[hidden] { display: none; }
.busy { opacity: 0.5; pointer-events: none; }
.loading { color: var(--ink-quiet); font-size: 14px; }

@media (max-width: 759px) {
  .apply { flex-direction: column; min-height: 100vh; }
  .rail { display: none; }
  .top-m { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 0; }
  .top-m .bar { display: flex; justify-content: space-between; align-items: center; }
  .top-m .brand { gap: 10px; }
  .top-m .brand img { width: 20px; }
  .top-m .brand-words .wm { font-size: 10px; }
  .top-m .link { font-size: 12px; color: var(--ink-quiet); background: none; border: 0; padding: 0; cursor: pointer; }
  .progress { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
  .progress div { height: 2px; background: var(--line); }
  .progress div.on { background: var(--ink); }
  .progress[hidden] { display: none; }
  .stage { padding: 28px 20px 32px; gap: 20px; flex-grow: 1; max-width: none; }
  .stage-head { gap: 8px; }
  .stage h1 { font-size: 32px; letter-spacing: -1.2px; line-height: 1.1; }
  .stage-head p { font-size: 14.5px; }
  .field { width: 100%; }
  .tiles, .fields-2 { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 14px 16px; min-height: 60px; }
  .tile .t { font-size: 14px; }
  .tile .s { font-size: 12px; }
  .line { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .line .note { grid-column: 1 / -1; }
  .actions { flex-direction: column-reverse; align-items: stretch; padding-top: 0; margin-top: auto; gap: 6px; }
  .actions .btn { width: 100%; }
  .actions .link { text-align: center; padding: 6px 0; }
  .editor .field { width: 100%; }
}
