/* Squedrill Dividends: the one style file. Every colour, size and font is a token here, so the look can be changed
   in one place (STRUCTURE.md 2.9). The look follows the mock-up (site/mockup). */
:root{
  --panel:#fffdf7;--panel2:#f4eddc;--ink:#233044;--mute:#66758a;--line:#e3dac6;
  --blue:#2f8de4;--blue-d:#1a63b0;--green:#43b05a;--gold:#c08a3e;--red:#e0524a;--navy:#1c3a5e;
  --glass:rgba(24,48,80,.82);--shadow:0 6px 18px rgba(10,30,60,.28);
  --font:"Trebuchet MS","Segoe UI",system-ui,sans-serif;
  --radius:16px;--gap:10px;--text:15px;--small:12px;
}
:root[data-theme=dark]{--panel:#1f2b3d;--panel2:#2a384d;--ink:#eef3fa;--mute:#9fb0c6;--line:#37485f;--glass:rgba(10,18,32,.86)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--panel:#1f2b3d;--panel2:#2a384d;--ink:#eef3fa;--mute:#9fb0c6;--line:#37485f;--glass:rgba(10,18,32,.86)}}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#cfe3ea;color:var(--ink);font-family:var(--font);font-weight:600;font-size:var(--text)}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer;padding:0}
button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.ic{width:1.25em;height:1.25em;vertical-align:-.3em;flex:none}

/* the 3D world fills the screen */
#world{position:fixed;inset:0;touch-action:none}
#world canvas{display:block;width:100%;height:100%;cursor:grab}
#world canvas:active{cursor:grabbing}

/* top bar */
#top{position:fixed;left:0;right:0;top:0;padding:max(8px,env(safe-area-inset-top)) 10px 0;display:flex;gap:8px;align-items:center;z-index:20;pointer-events:none}
#top>*{pointer-events:auto}
.lvl{position:relative;width:38px;height:38px;border-radius:50%;background:var(--glass);display:grid;place-items:center;box-shadow:var(--shadow);flex:none}
/* the same dark as the other buttons (user, 2026-10-05); the gold ring (progress to the next level) drawn over it */
.lvl::before{content:'';position:absolute;inset:2px;border-radius:50%;background:conic-gradient(var(--gold) calc(var(--p,0)*1%),rgba(255,255,255,.14) 0);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2.5px));mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2.5px))}
.lvl div{width:30px;height:30px;border-radius:50%;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px;line-height:1}
.lvl small{display:block;font-size:5.5px;opacity:.8;letter-spacing:.04em}
.pill{display:flex;align-items:center;gap:6px;background:var(--glass);color:#fff;border-radius:22px;padding:6px 14px 6px 8px;box-shadow:var(--shadow);font-size:16px;min-height:38px}
.pill small{font-size:10px;opacity:.75;display:block;line-height:1}
.pill b{display:block;line-height:1.1;font-variant-numeric:tabular-nums}
.pill .ic{width:26px;height:26px}
#tools{display:flex;gap:6px;margin-left:auto}
.rb{width:38px;height:38px;border-radius:50%;background:var(--glass);color:#fff;display:grid;place-items:center;box-shadow:var(--shadow);font-size:15px}
.rb.on{background:#2f6b34;box-shadow:0 0 0 2px #7fca5f,var(--shadow)}   /* a tool that's switched on (Eco health) */
.note-nature p{display:flex;gap:6px;align-items:flex-start}

/* a status line under the top bar */
#status{position:fixed;left:50%;transform:translateX(-50%);top:calc(max(8px,env(safe-area-inset-top)) + 58px);z-index:19;background:var(--navy);color:#fff;border-radius:12px;padding:6px 12px;font-size:var(--small);max-width:calc(100vw - 32px);text-align:center}
#status[hidden]{display:none}

/* cards: one at a time, from the bottom on a phone, at the side on a wide screen */
#cards{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;justify-content:center;padding:0 10px max(10px,env(safe-area-inset-bottom));pointer-events:none}
.card{pointer-events:auto;width:min(420px,100%);background:var(--panel);color:var(--ink);border-radius:var(--radius) var(--radius) 12px 12px;box-shadow:var(--shadow);padding:12px 14px;display:flex;flex-direction:column;gap:var(--gap)}
@media (min-width:800px){#cards{justify-content:flex-end;bottom:auto;top:76px;padding-right:12px}.card{border-radius:var(--radius)}
  #cards:has(.card.menu:not(.waiting)){justify-content:center;align-items:center;top:0;bottom:0;padding:0}}   /* the menu: in the middle */
.card header{display:flex;align-items:center;gap:8px}
.card h2{margin:0;font-size:19px;flex:1}
.card h2.slide{overflow:hidden;white-space:nowrap;min-width:0}            /* one line; a long title slides (kit.js setCardTitle) */
.card h2.slide span{display:inline-block}
.card p{margin:0;color:var(--mute);font-weight:500;line-height:1.35}
.card .x{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--panel2)}
.stats{display:flex;gap:8px;flex-wrap:wrap}
.stat{display:flex;align-items:center;gap:6px;background:var(--panel2);border-radius:12px;padding:6px 10px}
.stat small{display:block;font-size:10px;color:var(--mute);line-height:1}
.stat b{display:block;font-variant-numeric:tabular-nums}
.buttons{display:flex;gap:8px;flex-wrap:wrap}
.buttons.stack{flex-direction:column}.buttons.stack .btn{width:100%;justify-content:center}   /* the menu's buttons */
.btn{min-height:44px;padding:0 16px;border-radius:12px;background:var(--panel2);display:inline-flex;align-items:center;gap:6px}
.btn.main{background:linear-gradient(#58b0ff,var(--blue) 55%,var(--blue-d));color:#fff;box-shadow:0 3px 0 #124a85}
details summary{cursor:pointer;color:var(--mute);font-size:var(--small)}

/* short messages */
.toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%);z-index:50;background:var(--glass);color:#fff;border-radius:12px;padding:8px 14px;max-width:calc(100vw - 32px);transition:opacity .4s}
.toast.gone{opacity:0}

/* forms on cards (sign-in and the like) */
.form{display:flex;flex-direction:column;gap:8px}
.field{display:flex;flex-direction:column;gap:4px;font-size:var(--small);color:var(--mute)}
.field input,.field select{font:inherit;font-size:16px;color:var(--ink);background:var(--panel2);border:2px solid var(--line);border-radius:10px;padding:8px 10px;min-height:44px;width:100%}
.field input:focus,.field select:focus{outline:none;border-color:var(--blue)}
.field input[type=color]{padding:4px;height:48px;cursor:pointer}
.field .row{display:flex;gap:8px}
.field .row>*{flex:1;min-width:0}
.card .note{color:var(--blue-d);font-weight:600}
.card .note.err{color:var(--red)}
.btn:disabled{opacity:.55}
/* who you are, in the top bar */
/* your stickman's portrait, in a dark round button like the tools (signed out: grey, with "Sign in" under it) */
.who{position:relative;width:38px;height:38px;border-radius:50%;background:var(--glass);box-shadow:var(--shadow);cursor:pointer;flex:none;padding:0;overflow:visible}
.who .face{width:100%;height:100%;border-radius:50%;display:block}
.who small{position:absolute;left:50%;bottom:-7px;transform:translateX(-50%);white-space:nowrap;font-size:9px;font-weight:700;line-height:1;color:#fff;background:#2c2f36;border-radius:6px;padding:2px 5px;box-shadow:var(--shadow)}
.rb .ic{width:30px;height:30px}   /* the compass, leaf and scroll fill their button as your portrait does (user, 2026-10-05) */
.compass .ic{transition:transform .15s}
.dot{width:18px;height:18px;border-radius:50%;border:2px solid #fff;flex:none}
/* the model gallery (?gallery): a name under each model */
.gallery-labels{position:fixed;inset:0;pointer-events:none;z-index:5}
.gallery-labels span{position:absolute;left:0;top:0;background:var(--glass);color:#fff;border-radius:8px;padding:3px 8px;font-size:var(--small);white-space:nowrap}
/* parts of a building's card (shares...), and lists on cards */
.parts{display:flex;flex-direction:column;gap:8px;border-top:2px solid var(--line);padding-top:8px}
.part{display:flex;flex-direction:column;gap:6px}
.part h3{margin:0;font-size:16px;display:flex;align-items:center;gap:6px}
.card p.small{font-size:var(--small)}
.list{display:flex;flex-direction:column;gap:6px;max-height:46vh;overflow:auto}
.list .row{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--panel2);border-radius:12px;padding:8px 10px;text-align:left;min-height:48px}
.list .row b,.list .row span{display:block}
.list .row span{color:var(--mute);font-size:var(--small);font-weight:500}
.list .row .btn{min-height:40px;padding:0 12px;flex:none}
.list .link{flex:1;text-align:left}
/* the bottom buttons and the guide line above them */
#bottom{position:fixed;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));z-index:25;display:flex;gap:10px}
#bottom[hidden]{display:none}
.bb{min-width:76px;min-height:58px;border-radius:16px;background:var(--glass);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:var(--shadow);font-size:var(--small)}
.bb .ic{width:32px;height:32px}
#guide{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(10px,env(safe-area-inset-bottom)) + 66px);z-index:24;background:var(--panel);color:var(--ink);border-radius:12px;padding:6px 12px;font-size:var(--small);box-shadow:var(--shadow);max-width:calc(100vw - 32px);text-align:center}
#cards:not(:empty)~#guide,body:has(#cards .card) #guide,body:has(#cards .card) #bottom{display:none}
.list .row.locked{opacity:.6}
/* small forms inside a card part (a host's prices and Auto-sell) */
.row-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.row-form span{flex:1 1 0;min-width:0;color:var(--mute);font-weight:500}
.row-form{flex-wrap:nowrap}
/* where a building's goods go (Auto or My order): the choice, then a small Change button */
.where{display:flex;align-items:center;gap:8px;margin:-2px 0 6px}
.where span{flex:1 1 0;min-width:0;color:var(--mute);font-size:14px}
.where .btn{min-height:36px;padding:0 12px}
.row-form .num{width:76px;font:inherit;font-size:16px;padding:6px 8px;border-radius:10px;border:2px solid var(--line);background:var(--panel2);color:var(--ink);min-height:40px}
.row-form .num.wide{width:96px}   /* a haul quote's rates: 0.0005 */
.row-form .tick{display:flex;align-items:center;gap:4px;color:var(--mute)}
.row-form .btn{min-height:40px}
/* a warehouse's prices: one row a good (good, buys at, sells at, save) */
.price-row{display:grid;grid-template-columns:1fr 72px 72px auto;align-items:center;gap:6px}
.price-row span{color:var(--mute);font-weight:500;min-width:0;overflow-wrap:anywhere}
.price-row.head span{font-size:13px}
.price-row .num{width:100%;font:inherit;font-size:16px;padding:6px 4px;text-align:center;-moz-appearance:textfield;appearance:textfield;border-radius:10px;border:2px solid var(--line);background:var(--panel2);color:var(--ink);min-height:40px;box-sizing:border-box}
.price-row .btn{min-height:40px;padding:0 10px}
.price-row .num::-webkit-inner-spin-button,.price-row .num::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.price-row.head span{text-align:center}.price-row.head span:first-child{text-align:left}
/* on a phone the top bar keeps every button on screen: your account shows as its colour dot (or a person, signed out) */
@media (max-width:480px){#top{gap:6px}.pill{padding:6px 10px 6px 6px}#tools{gap:5px}}
.where select.pick{flex:1 1 0;min-width:0;font:inherit;font-size:16px;padding:6px 8px;border-radius:10px;border:2px solid var(--line);background:var(--panel2);color:var(--ink);min-height:40px}
/* the establishment card (DESIGN.md, 2026-10-04): three numbers for investors, then tabs */
.stats.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.stats.three .stat{flex-direction:column;align-items:stretch;gap:2px;padding:7px 8px}
.stats.three .stat small{display:flex;align-items:center;gap:4px;line-height:1.15}
.stats.three .stat small .ic{width:1.1em;height:1.1em}
.stats.three .stat b{font-size:16px}
.stats.three .stat em{font-style:normal;font-size:10px;color:var(--mute);font-weight:500;line-height:1.15}
.est{display:flex;flex-direction:column;gap:var(--gap)}
.card:has(.est){max-height:calc(100vh - 96px);overflow:auto}
.tabs{display:flex;gap:4px;background:var(--panel2);border-radius:12px;padding:4px}
.tabs button{flex:1;min-height:40px;border-radius:9px;color:var(--mute);font-size:14px}
.tabs button[aria-selected=true]{background:var(--panel);color:var(--ink);box-shadow:0 1px 3px rgba(10,30,60,.18)}
.pane{display:flex;flex-direction:column;gap:10px}
.pane[hidden]{display:none}
.chip{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 12px;font-size:14px;background:var(--panel2)}
.chip i{width:9px;height:9px;border-radius:50%;background:var(--mute)}
.chip.ok{background:color-mix(in srgb,var(--green) 18%,var(--panel))}.chip.ok i{background:var(--green)}
.chip.bad{background:color-mix(in srgb,var(--red) 18%,var(--panel))}.chip.bad i{background:var(--red)}
.rows{display:flex;flex-direction:column;gap:6px}
.rows .row{display:flex;align-items:center;gap:8px;background:var(--panel2);border-radius:12px;padding:8px 10px;min-height:44px}
.rows .row span{flex:1;min-width:0;font-weight:500;color:var(--mute)}
.rows .row b{font-variant-numeric:tabular-nums}
.bars{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;align-items:end;height:84px;padding:0 2px;border-bottom:2px solid var(--line)}
.bars div{background:var(--green);border-radius:5px 5px 0 0}
.bars div.neg{background:var(--red)}
.bars div:last-child{outline:2px solid var(--ink);outline-offset:-2px}
.days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;font-size:10px;color:var(--mute);text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
.holder{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--panel2);border-radius:12px;min-height:44px}
.holder .rank{width:18px;color:var(--mute);font-size:13px;text-align:center;font-variant-numeric:tabular-nums}
.holder .dot{width:14px;height:14px;border-radius:50%;flex:none;border:2px solid var(--panel)}
.holder .name{flex:1;min-width:0;display:flex;flex-direction:column}
.holder .name small{font-size:11px;color:var(--mute);font-weight:500}
.holder b{font-variant-numeric:tabular-nums;text-align:right}
.holder b small{display:block;font-size:11px;color:var(--mute);font-weight:500}
.holder.you{outline:2px dashed var(--blue);outline-offset:-2px}
button.holder{width:100%;text-align:left}                  /* a shareholder's row opens their card */
/* a player's name that opens their card, and that card's top (user, 2026-10-05) */
.owner-name.link{text-decoration:underline dotted;text-underline-offset:3px;font-weight:700}
.player-top{display:flex;align-items:center;gap:10px;color:var(--ink);font-weight:700}
.player-face{width:56px;height:56px;border-radius:50%;background:var(--glass);flex:none}
.group{display:flex;flex-direction:column;gap:8px;border:2px solid var(--line);border-radius:12px;padding:10px}
.group h3{margin:0;font-size:15px}
.group .where{margin:0}
.group .price-row{grid-template-columns:1fr 72px 72px}
.row-form select.pick{flex:0 1 auto;max-width:55%;font:inherit;font-size:16px;padding:6px 8px;border-radius:10px;border:2px solid var(--line);background:var(--panel2);color:var(--ink);min-height:40px}
.switch{display:inline-flex;align-items:center;gap:8px;color:var(--ink)}
.switch input{width:44px;height:26px;appearance:none;border-radius:999px;background:var(--line);position:relative;cursor:pointer;margin:0;transition:background .15s}
.switch input::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--panel);transition:left .15s}
.switch input:checked{background:var(--green)}
.switch input:checked::after{left:21px}
.btn.main:disabled{opacity:.5}
@media (prefers-reduced-motion:reduce){.switch input,.switch input::after{transition:none}}
.group .where span{font-weight:500}
/* the Build list (DESIGN.md, 2026-10-04): a picture, what it does and the cost of each building, grouped by level */
.card:has(.buildlist){max-height:calc(100vh - 96px);overflow:auto}
.buildlist{display:flex;flex-direction:column;gap:6px}
.buildlist h3.blvl{margin:6px 0 0;font-size:13px;color:var(--mute);letter-spacing:.04em;text-transform:uppercase;display:flex;align-items:center;gap:8px}
.buildlist h3.blvl::after{content:"";flex:1;height:2px;background:var(--line)}
.buildlist .list{display:flex;flex-direction:column;gap:6px}
.brow{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:var(--panel2);border-radius:12px;padding:6px 10px 6px 6px;min-height:76px}
button.brow:hover{outline:2px solid var(--line)}
.brow img,.brow .noimg{width:64px;height:64px;flex:none;border-radius:10px;background:var(--panel)}
.brow .noimg{display:grid;place-items:center;color:var(--mute)}
.brow .txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.brow b{font-size:15px}
.brow .does{font-size:12px;color:var(--mute);font-weight:500;line-height:1.3}
.brow .cost{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:12px;font-variant-numeric:tabular-nums}
.brow .cost .coins{font-weight:700;display:inline-flex;align-items:center;gap:3px}
.brow .cost .mat{display:inline-flex;align-items:center;gap:3px;color:var(--mute);font-weight:600}
.brow .cost .ic{width:14px;height:14px}
.brow.locked{opacity:.55}
.brow .badge{align-self:flex-start;font-size:11px;border-radius:8px;padding:3px 7px;background:var(--panel);color:var(--mute);display:inline-flex;align-items:center;gap:4px}
.brow .badge .ic{width:16px;height:16px;padding:2px;border-radius:4px;background:var(--mute)}
.brow .go{color:var(--blue);width:22px;height:22px}

/* the world picker (features/worlds): the page at /dividends, before any world loads */
.pill.brand{padding:8px 16px;font-size:16px}
.card.picker,.card:has(.newworld),.card:has(.closeworld){max-height:calc(100vh - 96px);overflow:auto}
.worlds{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.worlds li{display:flex;align-items:center;gap:8px}
.world{flex:1;display:flex;flex-direction:column;gap:2px;background:var(--panel2);border-radius:12px;padding:10px 12px;color:inherit;text-decoration:none;min-height:44px}
a.world:hover{outline:2px solid var(--blue)}
.world.off{opacity:.75}
.world .name{display:flex;align-items:center;gap:8px;font-size:17px}
.world em{font-style:normal;font-size:10px;background:var(--gold);color:#fff;border-radius:8px;padding:2px 7px}
.world small{color:var(--mute);font-size:var(--small);font-weight:500}
.world small.state{color:var(--blue-d);font-weight:600}
.world small.state.err{color:var(--red)}

/* a player's name with a dot in their colour (kit.js who()) */
.owner-name,.list .row .owner-name{display:inline;white-space:nowrap;color:var(--ink);font-weight:700}
.owner-name .dot,.list .row .owner-name .dot{display:inline-block;width:12px;height:12px;margin:0 4px 0 1px;vertical-align:-1px;border:2px solid var(--line)}
/* a card waiting behind one that stays until acknowledged (kit.js showCard hold) */
#cards .card.waiting{display:none}
/* a forest's logs left and growth (user, 2026-10-05): two tiles, each with a bar */
.stats.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.stat.meter{flex-direction:column;align-items:stretch;gap:3px;padding:7px 10px}
.stat.meter small{display:flex;align-items:center;gap:4px;line-height:1.15}
.stat.meter small .ic{width:1.1em;height:1.1em}
.stat.meter b{font-size:16px}
.stat.meter .bar{display:block;height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.stat.meter .bar i{display:block;height:100%;background:var(--green);border-radius:3px}
.forest-detail{display:flex;flex-direction:column;gap:8px}
/* the Trade card (user, 2026-10-05): a sideways row of goods, then the chosen good's prices, graph and stores */
.trade{display:flex;flex-direction:column;gap:10px;min-width:0}
.chips{display:flex;gap:6px;overflow-x:auto;scroll-snap-type:x proximity;padding:2px 2px 6px;margin:0 -2px;scrollbar-width:thin}
.chip{flex:none;display:flex;align-items:center;gap:6px;min-height:40px;padding:4px 12px 4px 6px;border-radius:20px;background:var(--panel2);color:var(--mute);font-size:14px;font-weight:700;scroll-snap-align:center;white-space:nowrap}
.chip .ic{width:28px;height:28px}
.chip[aria-selected=true]{background:var(--panel);color:var(--ink);box-shadow:0 0 0 2px var(--gold),0 1px 3px rgba(10,30,60,.18)}
.trade-good{display:flex;flex-direction:column;gap:10px}
.prices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.price{background:var(--panel2);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:2px}
.price small{display:flex;align-items:center;gap:5px;color:var(--mute);font-size:12px;font-weight:700}
.price small i,.legend i{display:inline-block;width:10px;height:10px;border-radius:50%}
.price b{display:flex;align-items:center;gap:5px;font-size:24px;font-variant-numeric:tabular-nums}
.price b .ic{width:22px;height:22px}
.price em{font-style:normal;font-size:12px;color:var(--mute);font-weight:600}
.price em.up{color:var(--green)}.price em.down{color:var(--red)}
.graph{display:flex;flex-direction:column;gap:6px}
.ranges button{min-height:34px}
.chart{width:100%;height:auto;display:block}
.chart .grid{stroke:var(--line);stroke-width:1}
.chart .axis{fill:var(--mute);font-size:10px;font-weight:600}
.legend{display:flex;gap:14px;font-size:12px;color:var(--mute);font-weight:700}
.legend span{display:flex;align-items:center;gap:5px}
/* the Shares card (user, 2026-10-05): three numbers in a row; a seller's line; the sell box's two fields side by side */
.prices.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.prices.three .price b{font-size:20px}
.prices.three .price b .ic{width:18px;height:18px}
.who-sells{display:flex;flex-direction:column;min-width:0}
.trade .form .row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.row.offer{flex-direction:column;align-items:stretch}         /* an offer: who and how many, then its buttons */
.row.offer .buttons{flex-wrap:nowrap}.row.offer .buttons .btn{flex:1;justify-content:center;min-height:40px;padding:0 8px}
.card:has(.trade){max-height:calc(100vh - 96px);overflow:auto}   /* the Trade and Shares cards scroll when tall */
