:root {
  --bg:#0d1a20; --tray:linear-gradient(150deg,#11212a,#152a2a 60%,#143027);
  --panel:#142028; --border:#2a3a3a; --fg:#e8efee; --muted:#9fb0aa;
  --jade:#9fe3c8; --amber:#e6c54a; --red:#e06c6c; --maxw:760px;
  font-family:system-ui, sans-serif;
}
@font-face{font-family:'Poppins';font-style:normal;font-weight:600;font-display:swap;src:url('../assets/fonts/poppins-600.woff2') format('woff2')}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);line-height:1.5;cursor:default;-webkit-user-select:none;user-select:none}
a{color:inherit;cursor:pointer}
.site-header{max-width:var(--maxw);margin:0 auto;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.brand{display:inline-flex;align-items:center;gap:.26em;font-weight:600;font-family:'Poppins',system-ui,sans-serif;letter-spacing:-.01em;text-decoration:none;color:var(--jade);font-size:2.5rem;line-height:1}
.brand-mark{width:1.04em;height:1.04em;flex:0 0 auto}
.header-actions{display:flex;gap:8px}
.header-actions button{font:inherit;font-size:.82rem;border:1px solid var(--border);background:var(--panel);color:var(--fg);border-radius:8px;padding:7px 12px;cursor:pointer}
.header-actions button:hover{border-color:var(--jade)}
.header-actions button .bi{font-size:.95rem;vertical-align:-.09em;margin-right:1px;color:var(--jade)}
main{max-width:var(--maxw);margin:0 auto;padding:6px 20px 64px}
.subtitle{color:var(--muted)}
.site-footer{max-width:var(--maxw);margin:32px auto 0;padding:16px 20px;color:var(--muted);font-size:.8rem;border-top:1px solid var(--border)}

/* logo: rounded-square tile, light backdrop so transparent marks read cleanly */
.logo{position:relative;display:inline-flex;align-items:center;justify-content:center;width:92px;height:92px;border-radius:26%;background:#fff;color:#33312e;font-weight:700;font-size:2rem;overflow:hidden;flex:0 0 auto;box-shadow:0 0 0 1px rgba(0,0,0,.06)}
.logo::after{content:attr(data-initial)}
.logo.has-img::after{content:none} /* image loaded -> don't let the initial show through transparency */
.logo img{position:absolute;inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:cover;border-radius:inherit}
.logo.new{background:transparent;color:var(--muted);box-shadow:inset 0 0 0 1px var(--border);border-radius:26%}
.logo-sm{width:42px;height:42px;font-size:1rem}
.logo-xs{width:22px;height:22px;font-size:.7rem;border-radius:30%}

/* tray */
.tray{position:relative;background:var(--tray);border-radius:24px;padding:24px 28px 20px;font-family:"Iowan Old Style",Georgia,serif;box-shadow:inset 0 0 0 1px rgba(159,227,200,.16),0 24px 60px -30px rgba(0,0,0,.7)}
/* region strip (the cluster level): grouped above the category switcher */
.regions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px 12px;margin:0 44px 9px;font-family:system-ui,sans-serif}
.regions .rgn{background:none;border:0;padding:0;cursor:pointer;color:var(--muted);font-size:.6rem;letter-spacing:.13em;text-transform:uppercase;line-height:1.5}
.regions .rgn:hover{color:var(--fg)}
.regions .rgn.on{color:var(--jade);font-weight:700}
/* category switcher: the current region's categories, current highlighted */
.cats{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:5px;margin:0 44px 18px;font-family:system-ui,sans-serif}
.cats .cat{background:none;border:0;padding:0;cursor:pointer;color:var(--muted);font-size:.66rem;letter-spacing:.04em;line-height:1.5;white-space:nowrap}
.cats .cat:hover{color:var(--fg)}
.cats .cat.on{color:var(--jade);font-weight:700}
.csep{color:var(--border);font-size:.66rem}
/* overflow hint: region has more categories than the visible window */
.cmore{color:var(--jade);opacity:.55;font-size:.95rem;line-height:1;align-self:center;flex:0 0 auto;user-select:none}
/* prev/next category buttons, pinned to the middle of each side of the panel */
.nav{position:absolute;top:50%;transform:translateY(-50%);z-index:5;display:flex;align-items:center;justify-content:center;width:30px;height:160px;border-radius:9px;background:rgba(159,227,200,.05);border:1px solid var(--border);color:var(--jade);opacity:.75;font-size:1.5rem;line-height:1;cursor:pointer}
.nav:hover{opacity:1;border-color:var(--jade)}
.nav-l{left:8px}
.nav-r{right:8px}
.compose{display:grid;grid-template-columns:1fr auto auto auto 1fr;align-items:center;column-gap:14px}
.unit{position:relative;display:flex;flex-direction:column;gap:5px;min-width:0;cursor:pointer}
.unit.from{align-items:flex-end;text-align:right}
.unit.to{align-items:flex-start;text-align:left}
.unit > .logo{display:none}  /* hide the unit's OWN big logo on wide (flanking slot shows it) — but NOT the menu option icons nested deeper */
.logo-slot{display:flex;align-items:center;justify-content:center;cursor:pointer}
.logo-slot.from .logo{filter:grayscale(.5);opacity:.82}
.nm{font-size:1.08rem;display:inline-flex;align-items:center;border-bottom:1px dotted transparent}
.unit.from .nm{color:#cdd8d4}
.unit:hover .nm{border-bottom-color:rgba(159,227,200,.5)}
/* custom name dropdown (logos beside each option) */
.menu{display:none;position:absolute;top:100%;margin-top:8px;z-index:40;min-width:190px;max-height:320px;overflow:auto;background:#0b181d;border:1px solid var(--border);border-radius:12px;padding:6px;box-shadow:0 18px 40px -12px rgba(0,0,0,.85);font-family:system-ui,sans-serif;cursor:auto}
.unit.open .menu{display:block}
.unit.from .menu{right:0}
.unit.to .menu{left:0}
.menu .opt{display:flex;align-items:center;gap:9px;width:100%;text-align:left;background:none;border:0;color:var(--fg);font:inherit;font-size:.92rem;padding:6px 8px;border-radius:8px;cursor:pointer;white-space:nowrap}
.menu .opt:hover{background:rgba(159,227,200,.1)}
.menu .opt.sel{color:var(--jade)}
.menu .opt .logo{box-shadow:none;flex:0 0 auto}
.opt-nm{overflow:hidden;text-overflow:ellipsis}
.sc{font-variant-numeric:tabular-nums;font-size:1rem}
.sc.from{color:#b6c2bd}
.sc.green{color:var(--jade);font-weight:700}.sc.amber{color:var(--amber);font-weight:700}.sc.low{color:var(--red);font-weight:700}
.axis{display:flex;flex-direction:column;align-items:center;gap:7px;cursor:pointer}
.axis .arrow{color:var(--jade)}
.arrow-svg{width:30px;height:30px}
.delta{font-size:.9rem;font-weight:700;padding:3px 11px;border-radius:999px;font-variant-numeric:tabular-nums}
.delta.up{background:rgba(159,227,200,.16);color:var(--jade)}.delta.down{background:rgba(224,108,108,.16);color:#ec9a9a}.delta.flat{background:rgba(255,255,255,.08);color:#b6c2bd}
.caret{font-size:.6rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-family:system-ui,sans-serif}
.expand{margin:16px 24px 0}
.cmpgrid{border-top:1px dashed rgba(159,227,200,.18);padding-top:12px;display:flex;flex-direction:column;gap:1px;font-size:.78rem}
.crow{position:relative;display:flex;align-items:center;gap:10px;padding:4px 6px;border-radius:7px;cursor:help}
.crow:hover,.crow:focus,.crow:focus-within{background:rgba(159,227,200,.08);outline:none}
.crow .ax-name{flex:1;min-width:0}
.crow .ax-name::after{content:" ⓘ";color:var(--muted);font-size:.7em;opacity:.5}
.crow .fv,.crow .tv{width:34px;text-align:center;font-weight:800}
.crow .ax-arrow{width:18px;text-align:center}
.gain{color:var(--jade)}.loss{color:#ec9a9a}.same{color:var(--muted)}
/* one explanation popover per row (general + both apps' notes) */
.tip{display:none;position:absolute;left:0;bottom:calc(100% + 6px);z-index:30;width:min(320px,82vw);background:#0b181d;border:1px solid var(--border);border-radius:10px;padding:11px 13px;box-shadow:0 14px 34px -10px rgba(0,0,0,.85);font-family:system-ui,sans-serif;font-size:.74rem;line-height:1.45;color:var(--fg);text-align:left;cursor:auto}
.crow:hover .tip,.crow:focus .tip,.crow:focus-within .tip{display:block}
.tip .tip-name{color:var(--jade);font-weight:700;display:block;margin-bottom:5px}
.tip .tip-anchors{display:block;color:var(--muted);margin-bottom:6px}
.tip .tip-anchors i{display:inline-block;width:1.4em;color:var(--jade);font-style:normal;font-weight:700;margin-right:2px}
.tip .tip-note{display:block;margin-top:3px}
.tip .tip-note b{color:#cdd8d4}
.foot{position:relative;margin-top:20px;padding-top:16px;display:flex;flex-direction:column;align-items:center;gap:14px}
.foot::before{content:"";position:absolute;top:0;left:5%;width:90%;height:1px;background:rgba(159,227,200,.14)}
.links{display:flex;gap:18px}
.links .il{display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--jade);opacity:.8;text-decoration:none;font-size:.55rem;letter-spacing:.05em;text-transform:uppercase;font-family:system-ui,sans-serif}
.links .il:hover{opacity:1}
.links .il svg{width:18px;height:18px}
.add{font-family:inherit;font-size:.92rem;color:#0d2620;background:var(--jade);border:0;border-radius:999px;padding:9px 26px;cursor:pointer}
.add.in{background:transparent;color:var(--jade);border:1px solid var(--jade)}

/* grid */
.planhead{display:flex;align-items:baseline;justify-content:space-between;margin:30px 4px 12px}
.planhead h3{margin:0;font-size:1rem;color:#cdd8d4}
.planhead .meta{font-size:.72rem;color:var(--muted)}
.empty{color:var(--muted);font-size:.85rem;text-align:center;padding:24px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px}
.gcard{position:relative;background:var(--panel);border-radius:16px;padding:14px 10px 12px;text-align:center;box-shadow:inset 0 0 0 1px rgba(159,227,200,.1);cursor:pointer;transition:box-shadow .12s}
.gcard:hover{box-shadow:inset 0 0 0 1px rgba(159,227,200,.3)}
.gcard .rm{position:absolute;top:7px;right:9px;color:#6f7d78;cursor:pointer;font-size:.85rem;border:0;background:none;opacity:0;transition:opacity .15s}
.gcard:hover .rm{opacity:1}
.mini{display:flex;align-items:center;justify-content:center;gap:5px;margin-bottom:8px}
.mini .ma{color:var(--fg);font-size:1.05rem;font-weight:800;margin:0 2px;opacity:.8}
.gname{font-size:.9rem;font-family:Georgia,serif}
.gd{font-size:.74rem;color:var(--jade);margin-top:2px}
.gstatus{margin-top:9px;font-size:.6rem;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);cursor:pointer;border:0;background:none;display:inline-flex;align-items:center;gap:5px}
.dot{width:7px;height:7px;border-radius:50%}
.d-want{background:var(--muted)}.d-trying{background:var(--amber)}.d-switched{background:var(--jade)}
.error{border:1px solid var(--red);border-radius:12px;padding:16px}

/* narrow screens: stack the swap, show in-unit logos */
@media (max-width:560px){
  .compose{grid-template-columns:1fr;justify-items:center;gap:10px}
  .logo-slot{display:none}
  .unit > .logo{display:inline-flex;margin-bottom:4px}
  .unit.from,.unit.to{align-items:center;text-align:center}
  .unit.from .nm{flex-direction:row}
  .nav{width:26px;height:130px;font-size:1.3rem}
  .nav-l{left:2px}.nav-r{right:2px}
  .cats{flex-wrap:wrap;margin:0 36px 16px}
  .unit .menu{left:50%;right:auto;transform:translateX(-50%)}
  .links{display:flex}
}

/* search */
#search-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
#search-wrap{position:relative;max-width:50%;flex:1 1 auto}
#report-btn{flex:0 0 auto;font:inherit;font-size:.82rem;border:1px solid var(--border);background:var(--panel);color:var(--fg);border-radius:8px;padding:7px 12px;cursor:pointer;white-space:nowrap}
#report-btn:hover{border-color:var(--jade)}
#report-btn .bi{font-size:.95rem;vertical-align:-.09em;margin-right:1px;color:var(--jade)}
#search{width:100%;padding:10px 14px 10px 38px;background:var(--panel);border:1px solid var(--border);border-radius:12px;color:var(--fg);font:inherit;font-size:.9rem;outline:none;-webkit-user-select:text;user-select:text;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239fb0aa' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.099zm-5.242 1.156a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:11px center}
#search:focus{border-color:var(--jade)}
#search::placeholder{color:var(--muted)}
#suggestions{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;background:#0b181d;border:1px solid var(--border);border-radius:12px;padding:4px;max-height:280px;overflow-y:auto;box-shadow:0 12px 30px -8px rgba(0,0,0,.8);font-family:system-ui,sans-serif}
.sug{display:flex;align-items:center;gap:9px;width:100%;text-align:left;background:none;border:0;color:var(--fg);font:inherit;font-size:.88rem;padding:6px 8px;border-radius:8px;cursor:pointer;white-space:nowrap}
.sug:hover,.sug:focus{background:rgba(159,227,200,.1);outline:none}
.sug-nm{flex:1;overflow:hidden;text-overflow:ellipsis}
.sug-cat{font-size:.72rem;color:var(--muted);flex-shrink:0}

/* report feature */
#report-dialog{width:min(480px,92vw);border:1px solid var(--border);border-radius:14px;background:var(--panel);color:var(--fg);padding:20px;box-shadow:0 20px 60px -12px rgba(0,0,0,.8)}
#report-dialog::backdrop{background:rgba(0,0,0,.55)}
#report-dialog h2{margin:0 0 4px;font-size:1.05rem}
#report-dialog .report-hint{margin:0 0 14px;color:var(--muted);font-size:.8rem}
#report-dialog label{display:block;margin:10px 0 4px;font-size:.8rem;color:var(--muted)}
#report-dialog select,#report-dialog input,#report-dialog textarea{width:100%;box-sizing:border-box;padding:8px 10px;background:#0b181d;border:1px solid var(--border);border-radius:8px;color:var(--fg);font:inherit;font-size:.88rem;outline:none}
#report-dialog select:focus,#report-dialog input:focus,#report-dialog textarea:focus{border-color:var(--jade)}
#report-dialog textarea{resize:vertical}
.report-field[hidden]{display:none}
.report-error{margin:10px 0 0;color:#ff9b9b;font-size:.8rem}
.report-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.report-actions button{font:inherit;font-size:.85rem;border:1px solid var(--border);border-radius:8px;padding:8px 14px;cursor:pointer}
.report-actions #report-submit{background:var(--jade);border-color:var(--jade);color:#06231a;font-weight:600}
.report-actions .ghost{background:var(--panel);color:var(--fg)}
.report-actions button:hover{border-color:var(--jade)}
