:root { --navy: #1B3A6B; --navy2: #2b5291; --gold: #C9956C; --green: #4A9B7F; --red: #c0392b; --amber: #b7791f;
  --ink: #16233a; --mute: #6b7689; --line: #e6e9ef; --bg: #f4f6fa; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body { font-family: -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--ink); font-size: 15px;
  -webkit-text-size-adjust: 100%; padding-bottom: env(safe-area-inset-bottom); }
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.loading { padding: 40px 20px; text-align: center; color: var(--mute); }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* top bars */
.hero { background: linear-gradient(170deg, var(--navy2) 0%, var(--navy) 80%); color: #fff; padding: calc(18px + env(safe-area-inset-top)) 20px 18px; }
.hero small { color: #c4d0e6; font-size: 13px; }
.hero h1 { font-size: 23px; margin: 2px 0 14px; }
.hero .row { display: flex; justify-content: space-between; align-items: center; }
.hero .out { background: none; border: 0; color: #c4d0e6; font-size: 13px; text-decoration: underline; }
.brand { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.seg { display: flex; background: rgba(255,255,255,.12); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; color: #d5deee; font-size: 13px; font-weight: 600; padding: 8px 0; border-radius: 9px; }
.seg button.on { background: #fff; color: var(--navy); }
.top { background: #fff; border-bottom: 1px solid var(--line); padding: calc(12px + env(safe-area-inset-top)) 18px 14px; position: sticky; top: 0; z-index: 3; }
.back { background: none; border: 0; color: var(--navy); font-weight: 600; font-size: 14px; padding: 4px 0; }
.top h2 { font-size: 21px; margin-top: 4px; }
.top h2 span { font-size: 14px; font-weight: 400; color: var(--mute); }
.top .asks { font-size: 13px; color: var(--mute); margin-top: 3px; }
.top .asks b { color: var(--navy); }

/* lists */
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); font-weight: 700; margin: 18px 16px 8px; }
.card { display: block; width: calc(100% - 28px); text-align: left; background: #fff; border: 0; border-radius: 16px; margin: 0 14px 10px;
  padding: 13px 14px; box-shadow: 0 4px 16px rgba(27,58,107,.07); position: relative; }
.card.new::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.card .r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 { font-size: 16px; }
.card h3 span { font-weight: 400; color: var(--mute); font-size: 13px; }
.card time { font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.card p { font-size: 13px; color: var(--navy); margin: 4px 0 8px; font-weight: 600; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 3px 8px; border-radius: 8px; background: #e8edf6; color: var(--navy); font-weight: 600; }
.chip.rd { background: #fbe7e5; color: var(--red); }
.chip.yl { background: #fdf1dc; color: var(--amber); }
.chip.gr { background: #e3f2ec; color: var(--green); }
.empty { text-align: center; color: var(--mute); padding: 40px 24px; font-size: 14px; }

/* case */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 14px; }
.photos button { border: 0; padding: 0; background: #dfe4ec; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; color: #fff; background: rgba(11,20,36,.55); padding: 3px 4px; font-weight: 600; }
.box { background: #fff; border-radius: 14px; margin: 0 14px; padding: 4px 13px; box-shadow: 0 4px 16px rgba(27,58,107,.06); }
.fl { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fl:last-child { border: 0; }
.fl i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #cfd6e2; }
.fl i.red { background: var(--red); } .fl i.yellow { background: var(--amber); }
.fl .v { margin-left: auto; color: var(--mute); text-align: right; max-width: 55%; }
.doc { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.doc:last-child { border: 0; }
.doc span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc .v { color: var(--navy); font-weight: 600; font-size: 13px; }
details.sec { background: #fff; border-radius: 14px; margin: 0 14px 8px; box-shadow: 0 4px 16px rgba(27,58,107,.06); }
details.sec summary { padding: 12px 13px; font-weight: 600; font-size: 14px; list-style: none; }
details.sec summary::after { content: "＋"; float: right; color: var(--mute); }
details.sec[open] summary::after { content: "－"; }
details.sec .rows { padding: 0 13px 6px; }
.hist { margin: 0 14px; border-left: 2px solid #d6dcea; padding-left: 14px; }
.hist div { font-size: 13.5px; padding: 5px 0; position: relative; }
.hist div::before { content: ""; position: absolute; left: -19px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.hist small { color: var(--mute); display: block; font-size: 12px; }
.note { background: #fff8ef; border: 1px solid #f0dcc3; border-radius: 12px; margin: 0 14px 8px; padding: 10px 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.note b { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; display: block; margin-bottom: 2px; }
.note.mine { background: #eef2f9; border-color: #d4dcec; }
.note.mine b { color: var(--navy); }

/* reply */
.panel { background: #fff; border-radius: 16px; margin: 18px 14px 10px; padding: 14px; box-shadow: 0 6px 20px rgba(27,58,107,.09); }
.panel h4 { font-size: 15px; margin-bottom: 4px; }
.panel .hint { font-size: 12.5px; color: var(--mute); line-height: 1.45; margin-bottom: 10px; }
.attach { display: block; text-align: center; background: var(--gold); color: #fff; border-radius: 14px; padding: 14px; font-weight: 700; font-size: 15px; }
.attach small { display: block; font-weight: 400; font-size: 12px; opacity: .92; margin-top: 2px; }
.attach input { display: none; }
.rec { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.rec audio { flex: 1; min-width: 0; height: 36px; }
.rec button { border: 0; background: none; color: var(--red); font-size: 13px; }
textarea, input[type=text], input[type=email], input[type=password] { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; font-size: 16px; }
textarea { min-height: 70px; resize: vertical; }
.field { margin-top: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--mute); margin-bottom: 5px; }
.oc { display: flex; gap: 6px; }
.oc button { flex: 1; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 4px; font-size: 12.5px; font-weight: 600; }
.oc button i { display: block; font-style: normal; font-size: 16px; margin-bottom: 2px; }
.oc button.on { border-color: var(--green); background: #eef7f3; color: var(--green); }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-weight: 700; font-size: 15px; margin-top: 14px; background: var(--navy); color: #fff; }
.btn:disabled { opacity: .5; }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.alt { display: flex; gap: 8px; margin: 0 14px 30px; }
.alt button { flex: 1; background: none; border: 1px dashed #b8c3d8; border-radius: 12px; padding: 10px 6px; font-size: 13px; font-weight: 600; color: var(--navy); }
.err { color: var(--red); font-size: 13px; margin-top: 8px; }
.done { text-align: center; padding: 20px 10px 10px; }
.done .tick { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 10px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 28px; }
.done p { color: var(--mute); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }

/* sign-in */
.auth { padding: 0 20px 40px; }
.auth .hero { margin: 0 -20px 20px; padding-bottom: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth p.sub { color: #c4d0e6; font-size: 14px; }
.link { background: none; border: 0; color: var(--navy); font-weight: 600; text-decoration: underline; margin-top: 16px; font-size: 14px; }

/* photo viewer */
.viewer { position: fixed; inset: 0; background: #0b1424; z-index: 10; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: calc(100% - 110px); object-fit: contain; }
.vclose { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 18px; }
.vbar { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 24px; color: #fff; font-size: 14px; }
.vbar button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 24px; }
