/* City panels read like a governor's tablets: a Latin heading, the numbers that matter
   and the controls within reach. Rules and fine print fold away under <details>. */
.panel-eyebrow{display:flex;align-items:center;gap:12px;font-family:Georgia,'Times New Roman',serif;font-size:12px;letter-spacing:.28em;color:#8b602d}
body:not(.compact-ui) .panel-eyebrow{font-size:12px}
.panel-eyebrow:after{content:'';flex:1;max-width:120px;height:1px;background:linear-gradient(90deg,#8b602d88,transparent)}
.panel-title{margin-top:4px}
.panel-note{margin:8px 0;font-size:12px;line-height:1.55;color:#6b5133}

/* Treasury ledger */
.ledger{display:flex;align-items:center;gap:20px;margin:14px 0 12px;padding:14px 18px;background:var(--papyrus-inset);border:1px solid #ab7e474a;border-radius:3px}
.ledger-treasury>span,.ledger-dial>strong{display:block;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#6b5133}
.ledger-treasury strong{display:block;margin-top:2px;font-family:Georgia,'Times New Roman',serif;font-size:34px;font-weight:400;line-height:1.1;color:#553d26;font-variant-numeric:tabular-nums}
.ledger-treasury em{font-size:15px;font-style:italic;color:#6b5133}
.ledger-flow{display:grid;gap:3px;margin-left:auto;min-width:170px;font-size:13px;color:#6b5133}
.ledger-flow span{display:flex;justify-content:space-between;gap:18px}
.ledger-flow span:last-child{margin-top:2px;padding-top:4px;border-top:1px solid var(--line)}
.ledger-flow b{font-variant-numeric:tabular-nums}
.gain{color:#3f6236}.loss{color:#963e2c}
.ledger-dials{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ledger-dial{display:grid;justify-items:start;gap:6px;padding:12px 14px;background:var(--papyrus-inset);border:1px solid #ab7e474a;border-radius:3px}
.ledger-dial .stepper{gap:10px}
.ledger-dial .stepper span{min-width:64px;text-align:center;font-family:Georgia,'Times New Roman',serif;font-size:22px;color:#553d26}
.ledger-dial .stepper button{display:grid;place-items:center;width:44px;height:44px}
.ledger-dial small{font-size:11px;line-height:1.4;color:#6b5133}
.ledger-alert{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin:12px 0 0}
.ledger-alert .warning-text{margin:0}
.ledger-alert .action-button{width:auto;margin:0}
.granary{margin:16px 0 4px}
.granary .info-row{margin:0 0 6px}
.granary .info-row span{display:flex;align-items:center;gap:7px}
.trade-table td:first-child{white-space:nowrap}
.trade-table td:first-child .roman-icon{vertical-align:-3px;margin-right:4px}
.granary .roman-icon,.trade-table .roman-icon{width:16px;height:16px;flex:none;color:#785a28}
.granary small{display:block;margin-top:6px;font-size:11px;color:#6b5133}
.granary .goal-track{height:6px}
.panel-section-title{display:flex;align-items:center;gap:10px}
.panel-section-title .status-tag{display:inline-block;width:auto;margin:0;padding:3px 8px;font-size:11px}
.ledger-details{margin:16px 0 0;border-top:1px solid var(--line)}
.ledger-details summary{display:flex;align-items:center;min-height:44px;cursor:pointer;color:#68542f;font-weight:600}
.ledger-details summary{list-style:none;gap:8px}
.ledger-details summary::-webkit-details-marker{display:none}
.ledger-details summary:before{content:'';width:7px;height:7px;border:solid #8b602d;border-width:0 2px 2px 0;transform:rotate(-45deg);transition:transform .15s}
.ledger-details[open] summary:before{transform:rotate(45deg)}
.ledger-details[open]{padding-bottom:6px}
.ledger-details .action-button{width:auto}
.ledger-rows{margin:4px 0 0}
.ledger-rows .info-row{margin:0;padding:8px 0;border-bottom:1px solid var(--line)}
.ledger-rows .info-row:last-child{border-bottom:0}
@media(max-width:520px){
  .trade-table th:nth-child(3),.trade-table td:nth-child(3){display:none}
  .ledger{flex-direction:column;align-items:stretch;gap:10px}
  .ledger-flow{margin-left:0;min-width:0}
  .ledger-dials{grid-template-columns:1fr}
  .ledger-dial{grid-template-columns:1fr auto;align-items:center}
  .ledger-dial small{grid-column:1/-1}
}

/* Game menu: the five places of the city as tablets, housekeeping as a quiet list. */
body dialog[data-panel="menu"][open]{max-width:600px}
.menu-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:6px}
.menu-grid button{min-height:76px;gap:8px;padding:10px 4px;font-family:Georgia,'Times New Roman',serif}
.menu-grid button>span{font-size:13px;letter-spacing:.02em;color:#553d26}
.menu-grid svg{width:24px;height:24px;color:#785a28}
.menu-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px;margin-top:14px;padding-top:10px;border-top:1px solid var(--line)}
.menu-list button{display:flex;align-items:center;gap:9px;min-height:44px;padding:6px 8px;border-radius:3px;text-align:left;font-size:13px;color:#60482b}
.menu-list button:hover{background:#8a5a2a14;color:#3b2a16}
.menu-list svg{width:17px;height:17px;flex:none;color:#8b6a3c}
.menu-list [data-panel-action="home"]{color:#7a3a24}
body:not(.compact-ui) .menu-grid button>span{font-size:13px}
body.compact-ui .menu-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
body.compact-ui .menu-grid button{min-height:64px;flex-direction:column;gap:5px;padding:6px 2px}
body.compact-ui .menu-grid button>span{font-size:12px;line-height:1.2}
body.compact-ui .menu-grid svg{width:22px;height:22px}
body.compact-ui .menu-list{margin-top:8px;padding-top:6px}
body.compact-ui .menu-list button{font-size:13px;padding:4px 6px}
@media(max-width:480px){
  body .menu-grid,body.compact-ui .menu-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
  body .menu-grid button,body.compact-ui .menu-grid button{padding:6px 0}
  body .menu-grid button>span,body.compact-ui .menu-grid button>span{font-size:9.5px;letter-spacing:-.01em}
  body.compact-ui .menu-grid svg{width:20px;height:20px}
  .menu-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(orientation:landscape) and (max-height:500px){
  .compact-ui .menu-list{grid-template-columns:repeat(4,minmax(0,1fr))}
  body.compact-ui dialog[data-panel=menu]{max-width:760px}
}
.panel-stat strong{font-family:Georgia,'Times New Roman',serif;font-weight:400}
