/* The app (/app): paper cards floating over the moving blue. Loads after site.css. */
.motion-fixed { position: fixed; }
.desk { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 96px var(--pad) 48px; }
.banner { margin-bottom: 18px; padding: 12px 16px; border: 2.5px solid var(--frame, var(--ink)); background: var(--paper); box-shadow: 5px 5px 0 var(--blue-deep); font: 500 14px/1.5 var(--mono); }
.banner b { background: var(--blue); color: var(--paper); padding: 1px 6px; border-radius: 3px; margin-right: 6px; }
.banner.warn b { background: var(--warn); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 24px; align-items: start; }
.card { background: var(--paper); border: 3px solid var(--frame, var(--ink)); box-shadow: 8px 8px 0 var(--blue-deep); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 3px solid var(--frame, var(--ink)); background: var(--paper-2); }
.card-head h1 { font-size: 30px; }
.tag { font: 600 12px/1 var(--mono); padding: 6px 9px; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 4px; white-space: nowrap; }
.new form { padding: 0 22px 22px; }
/* a legend is floated so it lays out as an ordinary block inside its fieldset (not on the border line) */
.new fieldset { border: 0; border-top: 2px dashed var(--line); margin: 0; padding: 22px 0 22px; min-width: 0; }
.new fieldset:first-of-type { border-top: 0; }
.new legend { float: left; width: 100%; font: 800 16px/1.2 var(--display); font-stretch: 110%; padding: 0; margin: 0 0 14px; color: var(--ink); }
.new legend + * { clear: both; }
.new .presets { margin-top: 0; }
.new .weights { margin-top: 14px; }
.limits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.limits label { display: grid; gap: 6px; font: 600 13px/1.2 var(--mono); color: var(--muted); }
.limits select, .usd-in { min-height: 44px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; font: 600 15px var(--mono); color: var(--ink); background: var(--paper); }
.usd-in { display: flex; align-items: center; gap: 4px; }
.usd-in i { font-style: normal; color: var(--muted); }
.usd-in input { border: 0; outline: 0; width: 100%; font: inherit; color: inherit; background: transparent; }
.pilots { display: grid; gap: 8px; }
.pilots label { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 15px; }
.pilots label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.pilots input { accent-color: var(--blue); width: 18px; height: 18px; }
.pilots span { color: var(--muted); font-size: 13px; text-align: right; }
.addr { margin-top: 10px; width: 100%; min-height: 44px; border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; font: 500 14px var(--mono); }
.dep { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; }
.dep select, .dep input, .dlg select, .dlg input { min-height: 44px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; font: 600 15px var(--mono); color: var(--ink); background: var(--paper); min-width: 0; }
.dep input:focus, .addr:focus, .dlg input:focus { border-color: var(--blue); outline: none; }
.hint { margin-top: 8px; font: 500 12.5px/1.5 var(--mono); color: var(--muted); }
.hint.bad { color: var(--warn); }
.submit { border-top: 2px dashed var(--line); padding-top: 20px; display: grid; gap: 12px; }
.submit .hint { margin-top: 0; }
.submit .btn { width: 100%; }
.say { font: 500 13px/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.say:empty { display: none; }
.say.bad { color: var(--warn); }
.say a { color: var(--blue); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.mine { display: grid; gap: 18px; }
.pilot-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; }
.pilot-card img { border-radius: 12px; border: 2.5px solid var(--frame, var(--ink)); }
.pilot-card b { display: block; font: 800 18px/1.1 var(--display); }
.pilot-card span { font: 500 12.5px/1.45 var(--mono); color: var(--muted); }
.mine-head { display: flex; justify-content: space-between; align-items: center; color: var(--paper); }
.mine-head h2 { color: var(--paper); font-size: 32px; text-shadow: 0 2px 0 var(--blue-deep); }
.list { display: grid; gap: 18px; }
.empty { padding: 26px 22px; color: var(--muted); }
.md-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 18px; border-bottom: 3px solid var(--frame, var(--ink)); }
.md-head h3 { font-size: 22px; }
.md-head .val { font: 900 26px/1 var(--display); font-stretch: 112%; color: var(--blue); }
.md-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.md-meta span { font: 600 11.5px/1 var(--mono); padding: 5px 8px; border-radius: 4px; background: var(--blue-soft); color: var(--blue); }
.md-meta span.off { background: #fde8dd; color: var(--warn); }
.md-rows { padding: 10px 18px 6px; display: grid; gap: 8px; }
.md-row { display: grid; grid-template-columns: 54px 1fr 112px; gap: 10px; align-items: center; font: 600 12.5px/1.2 var(--mono); }
.md-bar { position: relative; height: 16px; background: var(--paper-2); border: 1.5px solid var(--frame, var(--ink)); }
.md-bar i { position: absolute; inset: 0 auto 0 0; background: var(--blue); }
.md-bar s { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); text-decoration: none; }
.md-row em { font-style: normal; text-align: right; color: var(--muted); }
.md-row em b { color: var(--ink); }
.md-row .over b { color: var(--warn); }
.md-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; border-top: 2px dashed var(--line); margin-top: 8px; }
.md-foot .btn { min-height: 38px; padding: 0 14px; font-size: 13px; }
.md-note { padding: 0 18px 14px; font: 500 12px/1.5 var(--mono); color: var(--muted); }
.md-closed { opacity: 0.7; }
.app-legal { margin-top: 36px; color: rgba(255, 255, 255, 0.85); border-top: 1px solid rgba(255, 255, 255, 0.25); padding-top: 16px; font: 500 12px/1.6 var(--mono); }

.dlg { border: 3px solid var(--frame, var(--ink)); padding: 0; width: min(460px, calc(100vw - 24px)); box-shadow: 10px 10px 0 var(--blue-deep); border-radius: 14px; color: var(--ink); }
.dlg::backdrop { background: rgba(6, 16, 63, 0.6); }
.dlg-form header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--blue); color: var(--paper); }
.dlg-form header h3 { color: var(--paper); }
.dlg-x { background: rgba(255, 255, 255, 0.18); }
.dlg-body { padding: 18px 16px 6px; display: grid; gap: 12px; }
.dlg-body label { display: grid; gap: 6px; font: 600 13px/1.3 var(--mono); color: var(--muted); }
.dlg-body .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.dlg-form .say { padding: 0 16px; }
.dlg-form footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }

@media (max-width: 960px) {
  .desk-grid { grid-template-columns: 1fr; }
  .mine { order: -1; }
}
@media (max-width: 760px) {
  .desk { padding: 80px 12px 32px; }
  .top .btn-ghost { display: none; }
  .card { box-shadow: 5px 5px 0 var(--blue-deep); }
  .card-head { padding: 14px 16px; }
  .card-head h1 { font-size: 24px; }
  .new form { padding: 0 16px 18px; }
  .new fieldset { padding: 18px 0; }
  .limits-grid { grid-template-columns: 1fr; }
  .dep { grid-template-columns: 96px 1fr auto; }
  .md-row { grid-template-columns: 46px 1fr 96px; font-size: 11.5px; }
  .pilots label { grid-template-columns: 22px 1fr; gap: 4px 12px; align-items: center; }
  .pilots span { grid-column: 2; text-align: left; }
  .mine-head h2 { font-size: 26px; }
}

/* refinement pass: flat cards, hairlines, one soft shadow for what floats */
.card, .banner { box-shadow: none; border-width: 2px; }
.card-head { background: var(--paper); border-bottom-width: 2px; }
.md-head { border-bottom-width: 2px; }
.new fieldset, .submit, .md-foot { border-top: 1px solid var(--line); }
.new fieldset:first-of-type { border-top: 0; }
.mine-head h2 { text-shadow: none; }
.pilot-card img { border-width: 2px; }
.md-bar { border-width: 1px; }
.dlg { border-width: 2px; box-shadow: 0 24px 60px rgba(6, 16, 63, 0.35); }
.pilot-card span { font: 500 13.5px/1.45 var(--text); }
