/* Broker Accounts — look & feel based on the original Oracle Forms screens */
:root {
  --ink: #1b1b1b;
  --muted: #6b6b6b;
  --line: #c9c3a3;
  --bg: #f4f1e6;
  --bar: #151515;
  --yellow: #ffe500;
  --yellow-soft: #fbf1a9;
  --cell: #fffdf0;
  --red: #b0121b;
  --red-dark: #7d0b11;
  --green: #a9e58e;
  --green-dark: #2f7d1e;
  --pink: #f6b7ae;
  --blue: #4cc3e3;
  --neg: #c40d17;
  --pos: #11650c;
  --radius: 6px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
/* this software has one light look: keep form controls light even when the device is in dark mode */
html, :root, :root[data-theme] { color-scheme: light !important; }
input, select, textarea, button { color: var(--ink); }
input::placeholder { color: #8a8576; }
dialog { background: #fff; color: var(--ink); }
html { font-size: 14px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); }
a { color: #0c4f9e; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.b { font-weight: 600; }
.c { text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.zero { color: var(--muted); }
.big { font-size: 1.15rem; }
.spacer { flex: 1; }
.print-only { display: none; }
code { background: #eee7c7; padding: 1px 5px; border-radius: 3px; }

/* ---------- menubar ---------- */
.menubar { display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid #d8d2b8; padding: 0 14px; position: sticky; top: 0; z-index: 50; }
.menubar .brand { font-weight: 700; color: var(--ink); text-decoration: none; padding: 10px 10px 10px 0; margin-right: 6px; letter-spacing: .3px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; }
.dd { position: relative; }
.dd-head { display: block; padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; letter-spacing: .5px; user-select: none; }
.dd:hover .dd-head, .dd.open .dd-head { background: var(--yellow-soft); }
.dd-list { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid #d8d2b8; box-shadow: 0 8px 20px rgba(0,0,0,.12); list-style: none; margin: 0; padding: 4px 0; z-index: 60; }
.dd:hover .dd-list, .dd.open .dd-list { display: block; }
.dd-list a { display: block; padding: 8px 16px; color: var(--ink); text-decoration: none; text-transform: uppercase; font-size: .86rem; letter-spacing: .3px; }
.dd-list a:hover { background: var(--yellow-soft); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid #ccc; border-radius: 4px; font-size: 18px; padding: 2px 10px; }

.wrap { padding-block: 14px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1500px; margin: 0 auto; }

/* ---------- page bar (black with yellow title) ---------- */
.pagebar { display: flex; align-items: center; gap: 12px; background: var(--bar); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; flex-wrap: wrap; }
.pb-left, .pb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-left { flex: 1; }
.pb-right { flex: 1; justify-content: flex-end; }
.pb-title { margin: 0; background: var(--yellow); color: #111; font-size: 1.9rem; padding: 2px 18px; border-radius: 3px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.btn-exit { display: inline-block; background: #fff; color: #111; font-weight: 800; font-size: 1.15rem; text-decoration: none; padding: 6px 16px; border: 4px solid var(--red); border-radius: 3px; }
.btn-exit:hover { background: #ffecec; }
.find-box input { width: 260px; padding: 8px 10px; border: 3px solid #5fd35a; border-radius: 3px; font-size: 1rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 14px; font: inherit; font-weight: 600; color: #111; background: linear-gradient(#fff, #e9e6dc); border: 1px solid #9c9786; border-radius: 4px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: linear-gradient(#fff, #fdf2b0); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 3px 9px; font-size: .86rem; }
.btn-primary { background: linear-gradient(#2f8be0, #1d6cb8); color: #fff; border-color: #145392; }
.btn-primary:hover { background: linear-gradient(#3a96ea, #1b62a8); }
.btn-post { background: linear-gradient(#ffffff, #dcd8cb); border: 3px solid var(--red); font-size: 1.15rem; padding: 8px 26px; font-weight: 800; }
.btn-red { border: 3px solid var(--red); }
.btn-del { color: var(--red); border-color: #d9a0a0; }
.btn-del:hover { background: #ffe3e3; }
.btn-add { border: 3px solid var(--red); font-weight: 800; }
.btn-big { display: flex; width: 100%; padding: 12px; font-size: 1.15rem; border: 4px solid var(--red); margin-bottom: 8px; }
.btn-row { display: flex; gap: 8px; }

/* ---------- panels ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 14px; }
.panel h3 { margin: 2px 0 10px; font-size: 1.05rem; }
.panel-yellow { background: var(--yellow-soft); }
.panel-green { background: var(--green); border-color: #6fbf54; }
.panel-pink { background: #fde9e6; border-color: #e5a69c; }
.panel-grey { background: #e3e3df; }
.panel-plain { background: #fff; }
.panel-danger { background: #fff4f4; border-color: #e3a3a3; }
.empty-state { text-align: center; padding: 40px; color: var(--muted); font-size: 1.1rem; }
.narrow { max-width: 520px; }
.narrow-wide { max-width: 900px; }

/* ---------- tables ---------- */
.tbl-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--cell); }
.tbl-scroll.tall { max-height: calc(100vh - 290px); min-height: 260px; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--cell); }
.grid th { position: sticky; top: 0; background: #f5e98c; color: #111; font-weight: 700; padding: 7px 8px; border-bottom: 2px solid #b9ad5c; z-index: 2; white-space: nowrap; font-size: .95rem; }
.grid tfoot th { position: sticky; bottom: 0; top: auto; background: #f1e6a6; border-top: 2px solid #b9ad5c; border-bottom: 0; }
.grid td { padding: 5px 8px; border-bottom: 1px solid #e6e0c4; border-right: 1px solid #eee8cf; vertical-align: middle; }
.grid tbody tr:hover td { background: #fff7c7; }
.grid.clickable tbody tr { cursor: pointer; }
.grid .sr { text-align: center; color: #555; font-weight: 600; background: #fff59a; width: 1%; }
.grid td form { margin: 0; }
.grid-foot { padding: 6px 2px 0; font-size: .86rem; }
.grid-actions { display: flex; align-items: center; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
tr.obal td { background: #eef6ff !important; }
tr.srow td { background: #f3f0ff; }
tr.dirty td { background: #fff2cf !important; }
tr.just td { background: #dcf5d0 !important; }
tr.posted td { background: #e3f4da; }
tr.posted input:not([readonly]) { background: #f4fbf0 !important; }
tr.posted.dirty td { background: #fff2cf !important; }
tr.posted.dirty input:not([readonly]) { background: #fffaf0 !important; }
.row-legend { padding-top: 8px; }
.row-legend .lg { display: inline-block; width: 12px; height: 12px; border: 1px solid #b8b29a; vertical-align: -2px; margin: 0 4px 0 10px; }
.row-legend .lg:first-child { margin-left: 0; }
.lg-posted { background: #e3f4da; }
.lg-dirty { background: #fff2cf; }
.dlg-q .q-body p { margin: 4px 0; }
.dlg-q .dlg-btns { margin-top: 16px; }
.keys-hint { font-size: .82rem; }
tr.subtot td { background: #f6efc9; font-weight: 700; }

/* entry grids: inputs fill cells */
.grid.entry td { padding: 2px; }
.grid.entry input, .grid.entry select { width: 100%; padding: 6px 6px; border: 1px solid #d7d0ac; background: #fff; font: inherit; border-radius: 2px; min-width: 0; }
.grid.entry input:focus, .grid.entry select:focus { outline: 2px solid #2f8be0; outline-offset: -1px; background: #fffef3; }
.grid.entry input[readonly] { background: #f2efe2; color: #333; font-weight: 600; }
input.num { text-align: right; }
input.invalid { outline: 2px solid var(--red) !important; background: #ffecec !important; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #ece8d6; font-size: .78rem; font-weight: 600; color: #444; text-decoration: none; }
.tag-exp { background: #ffd9d9; color: #9b0b12; }
.tag-cash { background: #d6f2cf; color: #23620f; }
.tag-sale { background: #e2dcff; color: #3a2a99; }
.lock { opacity: .6; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters.inline { display: inline-flex; margin: 0; }
.filters input, .filters select { padding: 6px 8px; border: 1px solid #b7b09a; border-radius: 4px; background: #fff; }
.lbl { font-weight: 600; font-size: .92rem; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: .92rem; }
.period-custom { display: inline-flex; align-items: center; gap: 5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label, .dlg label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
.stack input:not([type=radio]):not([type=checkbox]):not([type=file]), .dlg input, .dlg select { padding: 8px 10px; border: 1px solid #b7b09a; border-radius: 4px; font-weight: 400; }
.stack label:has(input[type=radio]) { flex-direction: row; align-items: center; font-weight: 400; }
.view-label { margin: -4px 0 8px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; font-weight: 500; transition: opacity .6s; }
.flash-ok { background: #e2f6dc; border: 1px solid #93cf82; color: #1f5a10; }
.flash-err { background: #ffe5e5; border: 1px solid #e59b9b; color: #8a0b10; }
.flash.fade { opacity: 0; height: 0; padding: 0; margin: 0; border: 0; overflow: hidden; }

/* ---------- picker ---------- */
.pk { position: relative; }
.pk input.pick { width: 100%; }
.pick-box { position: absolute; z-index: 1000; background: #fff; border: 1px solid #9c9786; box-shadow: 0 10px 24px rgba(0,0,0,.18); max-height: 300px; overflow-y: auto; border-radius: 4px; display: none; max-width: 92vw; }
.pk-it { display: flex; justify-content: space-between; gap: 14px; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f1eddc; white-space: nowrap; }
.pk-it small { color: var(--muted); }
.pk-it.on, .pk-it:hover { background: #ffe97a; }
.pk-empty, .pk-more { padding: 8px 10px; color: var(--muted); font-size: .9rem; }

/* ---------- list of accounts ---------- */
.loa { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.side-box { border-radius: var(--radius); padding: 12px; margin-bottom: 12px; border: 3px solid var(--bar); }
.side-green { background: #5fd35a; }
.side-blue { background: var(--blue); }
.sb-label { font-size: 1.3rem; font-weight: 700; margin: 4px 0; }
.sb-label.sm { font-size: .95rem; text-align: center; }
.sb-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sb-val { flex: 1; background: #fff; padding: 6px 10px; font-size: 1.45rem; font-weight: 600; border-radius: 3px; }
.sb-val.full { display: block; text-align: center; font-size: 1.25rem; margin-bottom: 6px; }

/* ---------- ledger ---------- */
.ledger-head { margin-bottom: 4px; }
.ledger-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; background: var(--yellow-soft); padding: 10px 14px; border-radius: var(--radius); }
.lt-name { font-size: 1.5rem; font-weight: 800; }
.totals-box { margin-left: auto; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.totals-box div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.totals-box span { font-weight: 600; }
.totals-box b { background: #a9e58e; padding: 5px 14px; min-width: 160px; text-align: right; border-radius: 3px; font-size: 1.05rem; }

/* ---------- sale bill ---------- */
.bill-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.bill-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.bh-field { display: flex; flex-direction: column; gap: 4px; }
.bh-field.grow { flex: 1; min-width: 260px; }
.bh-field label { font-weight: 700; }
.bh-field input { padding: 8px 10px; border: 1px solid #b7b09a; border-radius: 4px; font-size: 1.05rem; }
.bh-field .page-no { width: 110px; font-weight: 800; background: #fff59a; }
.sale-grid th { background: #f3a99f; border-bottom-color: #c9786d; }
.sale-grid tfoot th { background: #f8cfc8; border-top-color: #c9786d; }
.tw-box, .bill-totals > div { display: flex; align-items: center; gap: 8px; }
.tw-box span, .bill-totals span { background: #fff; border: 1px solid #c9b5ac; padding: 6px 14px; min-width: 150px; text-align: right; font-weight: 700; font-size: 1.1rem; border-radius: 3px; }
.bill-totals { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.bill-totals label, .tw-box label { font-weight: 700; }
.bill-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- reports ---------- */
.rep-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rep-title { margin: 6px 0 10px; font-size: 1.25rem; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rep-grid > * { min-width: 0; overflow-x: auto; }
.loa > *, .two-col > * { min-width: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; border-bottom: 2px solid #b9ad5c; }
.tab { padding: 8px 14px; text-decoration: none; color: var(--ink); background: #eee9d2; border-radius: 4px 4px 0 0; font-weight: 600; }
.tab.on { background: var(--yellow); }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat b { font-size: 1.2rem; }
.stat.big { background: var(--yellow); border-color: #c8b400; }
.stat.big b { font-size: 1.6rem; }
.pos-strong { color: var(--pos); }

/* ---------- misc pages ---------- */
.two-col { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dlg { border: 0; border-radius: 10px; padding: 20px; width: min(520px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg h2 { margin: 0 0 14px; }
.dlg form { display: flex; flex-direction: column; gap: 12px; }
.dlg fieldset { border: 1px solid #ddd6b8; border-radius: 6px; }
.row3 { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 10px 18px; border-radius: 6px; opacity: 0; transition: .3s; z-index: 2000; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-err { background: var(--red); }

/* themes */
body.theme-green { background: #eaf5e1; }
body.theme-sale { background: #f7f0ec; }

/* auth: see "login page" at the end */

/* ---------- responsive ---------- */
@media screen and (max-width: 1000px) {
  .loa, .two-col, .rep-grid { grid-template-columns: 1fr; }
  .pb-title { font-size: 1.4rem; }
}
@media screen and (max-width: 760px) {
  /* entry & list tables become cards on phones */
  .grid.cards thead { display: none; }
  .grid.cards, .grid.cards tbody, .grid.cards tfoot { display: block; width: 100%; background: transparent; }
  .tbl-scroll:has(.grid.cards) { border: 0; background: transparent; overflow: visible; }
  .grid.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
  .grid.cards tbody tr:hover td { background: transparent; }
  .grid.cards td, .grid.cards tfoot th { display: block; border: 0; padding: 2px 0; text-align: left; background: transparent; position: static; min-width: 0; }
  .grid.cards td[data-label]::before, .grid.cards tfoot th[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
  .grid.cards td.full, .grid.cards td.wide { grid-column: 1 / -1; }
  .grid.cards td.sr { width: auto; background: transparent; text-align: left; font-size: .8rem; }
  .grid.cards td.sr::before { content: "# "; }
  .grid.cards td.act { grid-column: 2; justify-self: end; align-self: start; grid-row: 1; }
  .grid.cards td.r, .grid.cards td.c { text-align: left; }
  .grid.cards tfoot tr { background: #f1e6a6; }
  .grid.cards tfoot th:empty { display: none; }
  .grid.cards tr.srow, .grid.cards tr.obal { background: #f3f0ff; }
  .grid.cards tr.dirty { background: #fff2cf; }
  .grid.cards tr.just { background: #dcf5d0; }
  .grid.cards tr.posted { background: #e3f4da; }
  .grid.cards tr.posted.dirty { background: #fff2cf; }
  .keys-hint { display: none; }
  .grid.cards tr.nrow { border-style: dashed; }
  .grid.entry.cards input { padding: 9px 8px; font-size: 16px; }
  .loa .side { order: -1; }
  .side-box { margin-bottom: 8px; }
  .totals-box { max-width: none; }
  .totals-box b { min-width: 0; }
  .bill-totals { align-items: stretch; width: 100%; }
  .bill-totals > div, .tw-box { justify-content: space-between; width: 100%; }
  .grid-actions .spacer { display: none; }
  .btn-post { width: 100%; }
  .bill-actions { flex-wrap: wrap; }
  .filters input, .filters select { font-size: 16px; }
  .filters .pk { width: 100% !important; }
}
@media screen and (max-width: 700px) {
  html { font-size: 13px; }
  .menu-toggle { display: block; }
  .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; border-bottom: 1px solid #ccc; }
  body.menu-open .menu { display: flex; }
  .dd-list { position: static; box-shadow: none; border: 0; padding-left: 10px; }
  .dd:hover .dd-list { display: none; }
  .dd.open .dd-list { display: block; }
  .pagebar { justify-content: center; }
  .pb-left, .pb-right { flex: 0 0 auto; }
  .find-box input { width: 100%; }
  .row3 { grid-template-columns: 1fr; }
  .tbl-scroll.tall { max-height: none; }
}

/* ---------- print (A4) ---------- */
@page { size: A4; margin: 12mm 10mm; }
@media print {
  html { font-size: 11px; }
  body { background: #fff !important; }
  .no-print, .menubar, .pagebar, .flash { display: none !important; }
  .print-only { display: block !important; }
  .wrap { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; background: #fff !important; }
  .tbl-scroll, .tbl-scroll.tall { max-height: none !important; overflow: visible; border: 0; }
  .grid { background: #fff; }
  .grid th { position: static; background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border: 1px solid #999; }
  .grid td { border: 1px solid #bbb; background: #fff !important; }
  .grid thead { display: table-header-group; }
  .grid tfoot { display: table-footer-group; }
  .grid tr { page-break-inside: avoid; }
  .neg { color: #000; font-weight: 600; }
  a { color: #000; text-decoration: none; }
  .print-head { border-bottom: 2px solid #000; margin-bottom: 8px; padding-bottom: 6px; text-align: center; position: relative; }
  .ph-name { font-size: 1.6rem; font-weight: 800; }
  .ph-title { font-size: 1.25rem; font-weight: 700; }
  .ph-sub { font-size: 1rem; }
  .ph-date { position: absolute; right: 0; top: 0; font-size: .85rem; }
  .stat-row { display: flex; }
  .stat { border: 1px solid #999; }
  .tabs { display: none; }
  .loa, .two-col { display: block; }
  .side { display: flex; gap: 8px; margin-top: 10px; }
  .side-box { flex: 1; border: 1px solid #999 !important; background: #fff !important; padding: 6px; margin: 0; }
  .side-box .btn { display: none; }
  .grid.cards td::before { content: none !important; }
  .dev-foot, .wrap > * { animation: none !important; }
  .filters, .rep-actions, .grid-actions, .keys-hint, .demo-strip, .bill-nav, .bill-actions, .row-legend, .save-state { display: none !important; }
  .grid .btn, .grid .lock { display: none !important; }
  .grid.rep th { width: auto !important; }
  .grid.rep td.nowrap, .grid.rep td.r { white-space: nowrap; }
  .auth-bg { display: none; }
}

/* ---------- edit entry dialog ---------- */
.btn-edit { color: #0c4f9e; border-color: #9fb7d6; }
.btn-edit:hover { background: #e3eeff; }
.dlg-edit { width: min(620px, 95vw); }
.dlg-edit h2 small { font-size: .85rem; font-weight: 600; }
.te-note { background: #fff7c7; border: 1px solid #e8d77a; border-radius: 6px; padding: 8px 10px; font-size: .9rem; }
.te-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.te-grid .te-wide { grid-column: 1 / -1; }
.te-grid input:disabled { background: #f1efe8; color: #555; }
.dlg-edit .dlg-btns { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.dlg-edit .spacer { flex: 1; }
.pick-box.in-dlg { position: fixed; z-index: 10; }
@media screen and (max-width: 560px) { .te-grid { grid-template-columns: 1fr; } .dlg-edit .dlg-btns { flex-wrap: wrap; } }

/* ---------- gentle motion on screens ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.wrap > .pagebar { animation: fadeIn .35s ease both; }
.loa > * { animation: riseIn .5s cubic-bezier(.2,.7,.2,1) both; }
.loa > .side .side-box { animation: riseIn .55s cubic-bezier(.2,.7,.2,1) both; }
.loa > .side .side-box:nth-child(1) { animation-delay: .08s; }
.loa > .side .side-box:nth-child(2) { animation-delay: .16s; }
.loa > .side .side-box:nth-child(3) { animation-delay: .24s; }
.loa > .side .side-box:nth-child(4) { animation-delay: .32s; }
.side-box { transition: transform .2s ease, box-shadow .2s ease; }
.side-box:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.btn-big { transition: transform .15s ease, box-shadow .15s ease; }
.btn-big:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 6px 14px rgba(0,0,0,.2); }
.dev-foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 18px 10px 22px; }
.dev-foot b { color: var(--ink); }
.dev-foot a { color: inherit; }

/* ---------- login page ---------- */
body.auth { min-height: 100vh; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; overflow-x: hidden;
  background: radial-gradient(1200px 600px at 10% -10%, #3a2f10 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #3b1f0c 0%, transparent 55%), #121110; color: #fff; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.auth-bg span { position: absolute; display: block; border-radius: 50%; opacity: .55; animation: drift 18s ease-in-out infinite; }
.auth-bg .glow { width: 420px; height: 420px; filter: blur(70px); opacity: .35; background: #ffcc00; top: -120px; left: -80px; animation-duration: 22s; }
.auth-bg .glow.g2 { background: #ff7a1a; top: auto; bottom: -160px; left: auto; right: -100px; animation-delay: -8s; }
.auth-bg .nut { width: 34px; height: 56px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: linear-gradient(140deg, #d9a066, #8a5428); box-shadow: inset -4px -6px 10px rgba(0,0,0,.25); }
.auth-bg .seed { width: 12px; height: 12px; background: #e9c46a; box-shadow: 0 0 12px rgba(255,214,90,.6); }
.auth-bg .n1 { top: 14%; left: 8%; transform: rotate(-25deg); animation-delay: -2s; }
.auth-bg .n2 { top: 70%; left: 14%; transform: rotate(30deg); animation-delay: -6s; animation-duration: 21s; }
.auth-bg .n3 { top: 22%; right: 9%; transform: rotate(15deg); animation-delay: -10s; animation-duration: 24s; }
.auth-bg .n4 { bottom: 10%; right: 18%; transform: rotate(-40deg); animation-delay: -4s; }
.auth-bg .s1 { top: 40%; left: 4%; animation-delay: -3s; animation-duration: 14s; }
.auth-bg .s2 { top: 8%; left: 46%; animation-delay: -7s; animation-duration: 16s; }
.auth-bg .s3 { bottom: 16%; left: 40%; animation-delay: -1s; animation-duration: 13s; }
.auth-bg .s4 { top: 56%; right: 6%; animation-delay: -9s; animation-duration: 15s; }
@keyframes drift { 0%, 100% { translate: 0 0; rotate: 0deg; } 33% { translate: 18px -26px; rotate: 12deg; } 66% { translate: -14px 16px; rotate: -10deg; } }
.auth-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; width: min(900px, 100%); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); animation: riseIn .7s cubic-bezier(.2,.7,.2,1) both; }
.auth-hero { position: relative; padding: 38px 34px; background: linear-gradient(150deg, #1d1b16 0%, #2a2414 55%, #3a2a0f 100%); overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; inset: auto -60px -60px auto; width: 220px; height: 220px; border-radius: 50%; border: 26px solid rgba(255,229,0,.08); }
.ah-mark { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: var(--yellow); color: #151515; font-weight: 900; font-size: 1.35rem; letter-spacing: -.5px;
  box-shadow: 0 10px 30px rgba(255,229,0,.25); animation: pop .6s .2s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-hero h1 { margin: 18px 0 4px; font-size: 1.9rem; line-height: 1.15; color: #fff; animation: riseIn .6s .25s both; }
.ah-tag { margin: 0 0 22px; color: #e8d98a; font-weight: 600; animation: riseIn .6s .32s both; }
.ah-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ah-feats li { display: flex; align-items: center; gap: 10px; color: #f1ecd8; animation: riseIn .55s both; }
.ah-feats li:nth-child(1) { animation-delay: .42s; } .ah-feats li:nth-child(2) { animation-delay: .52s; } .ah-feats li:nth-child(3) { animation-delay: .62s; } .ah-feats li:nth-child(4) { animation-delay: .72s; }
.ah-feats i { flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,229,0,.14); color: var(--yellow); font-style: normal; font-size: .85rem; }
.auth-card { background: #fffdf6; color: var(--ink); padding: 38px 34px; display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { margin: 0; font-size: 1.5rem; animation: riseIn .6s .3s both; }
.auth-card .sub { margin: 4px 0 22px; color: var(--muted); animation: riseIn .6s .36s both; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; animation: riseIn .6s .44s both; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.auth-card input { padding: 12px 14px; border: 1.5px solid #d8d0b4; border-radius: 10px; font-size: 1rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.auth-card input:focus { outline: none; border-color: #c9a400; box-shadow: 0 0 0 4px rgba(255,214,0,.25); }
.auth-card .btn-login { position: relative; overflow: hidden; margin-top: 4px; padding: 13px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; font-size: 1.02rem; letter-spacing: .3px;
  color: #151515; background: linear-gradient(90deg, #ffd400, #ffe95c); cursor: pointer; box-shadow: 0 8px 20px rgba(201,164,0,.35); transition: transform .15s, box-shadow .15s; }
.auth-card .btn-login:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(201,164,0,.45); }
.auth-card .btn-login::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); animation: shine 3.2s 1.2s infinite; }
@keyframes shine { 0% { left: -60%; } 40%, 100% { left: 130%; } }
.auth-card .flash { margin: 0 0 4px; }
.auth-card .hint { font-size: .85rem; color: var(--muted); margin: -8px 0 14px; }
.dev-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 14px; width: min(900px, 100%);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px); animation: riseIn .7s .55s both; }
.dev-avatar { flex: 0 0 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #151515; background: conic-gradient(from 200deg, #ffd400, #ff9a1f, #ffd400); }
.dev-by { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.4px; color: #bfb48a; }
.dev-name { font-weight: 800; font-size: 1.05rem; color: #fff; }
.dev-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 3px; }
.dev-links a { display: inline-flex; align-items: center; gap: 6px; color: #f3e9b8; text-decoration: none; font-size: .9rem; }
.dev-links a:hover { color: #fff; text-decoration: underline; }
.dev-links svg { width: 15px; height: 15px; flex: 0 0 15px; }
@media screen and (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 26px 22px; }
  .auth-hero h1 { font-size: 1.5rem; margin-top: 12px; }
  .ah-feats { grid-template-columns: 1fr 1fr; gap: 8px; font-size: .9rem; }
  .auth-card { padding: 26px 22px; }
  .dev-card { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* simple white box (install page) */
.auth-box { position: relative; z-index: 1; background: #fffdf6; color: var(--ink); padding: 28px; border-radius: 14px; width: min(420px, 100%); border-top: 8px solid var(--yellow); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.auth-box h1 { margin: 0 0 18px; font-size: 1.5rem; }
.auth-box form { display: flex; flex-direction: column; gap: 12px; }
.auth-box label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.auth-box input { padding: 10px; border: 1px solid #bbb; border-radius: 6px; font-size: 1rem; }
.btn[hidden], .dlg [hidden] { display: none !important; }

/* ---------- About / Developer ---------- */
.about-wrap { display: flex; justify-content: center; padding: 24px 0; }
.about-card { width: min(560px, 100%); background: #fffdf6; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 14px 40px rgba(0,0,0,.12); animation: riseIn .5s cubic-bezier(.2,.7,.2,1) both; }
.ab-top { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.ab-top .ah-mark { flex: 0 0 58px; animation: none; }
.ab-app { font-size: 1.4rem; font-weight: 800; }
.ab-dev { display: flex; align-items: center; gap: 14px; margin: 18px 0 14px; }
.ab-dev .dev-by { color: var(--muted); }
.ab-name { font-size: 1.25rem; font-weight: 800; }
.ab-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ab-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: #151515; color: #fff; text-decoration: none; transition: transform .15s, box-shadow .15s; overflow-wrap: anywhere; }
.ab-link span { font-size: .75rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--yellow); }
.ab-link:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.25); }
@media screen and (max-width: 560px) { .ab-links { grid-template-columns: 1fr; } }
