/* ui — shared components: plate, chunky buttons, segmented control, chips, bars, action buttons */
@layer ui {
  .plate { position: relative; padding: 12px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--plate-hi), var(--plate)); box-shadow: inset 0 1px 0 var(--rim), 0 var(--depth) 0 var(--edge); }
  .note { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
  .note b { color: var(--dust-ink); }
  .note.center { text-align: center; }
  .empty { margin-top: 8px; font-size: 12px; color: var(--ink-3); }

  .section-head > .seg { flex: none; }
  .section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 2px 8px; }
  .sh-title { font-size: 14px; font-weight: 900; letter-spacing: .04em; }
  .sh-hint { font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .mini-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
  .mini-head b { font-size: 13px; color: var(--ink); }

  /* chunky button: a lit face over a hard bottom edge that collapses when pressed */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 900; text-align: center; color: var(--ink); background: linear-gradient(180deg, var(--plate-hi), var(--plate)); box-shadow: inset 0 1px 0 var(--rim), 0 var(--depth) 0 var(--edge); transition: transform .08s, box-shadow .08s, filter .15s; }
  .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .btn:active:not(:disabled) { transform: translateY(var(--depth)); box-shadow: inset 0 1px 0 var(--rim), 0 0 0 var(--edge); }
  .btn.primary { color: var(--buy-ink); background: linear-gradient(180deg, #6df0a4, var(--buy)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 var(--depth) 0 var(--buy-edge); }
  .btn.primary:active:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 0 var(--buy-edge); }
  .btn.danger { color: #fff; background: linear-gradient(180deg, #ff7f95, var(--bad)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 var(--depth) 0 #a3233f; }
  .btn.ghost { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px var(--line); }
  .btn.wide { display: flex; width: 100%; margin-top: 10px; }
  .btn.sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .btn:disabled { opacity: .45; filter: grayscale(.4); }
  @media (hover: hover) and (pointer: fine) { .btn:hover:not(:disabled) { filter: brightness(1.08); } }

  .icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); background: linear-gradient(180deg, var(--plate-hi), var(--plate)); box-shadow: inset 0 1px 0 var(--rim), 0 3px 0 var(--edge); }
  .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .icon-btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 var(--rim), 0 0 0 var(--edge); }

  /* segmented control */
  .seg { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35); }
  .seg button { flex: 1; min-width: 44px; min-height: 40px; padding: 0 10px; white-space: nowrap; border-radius: 999px; font-size: 13px; font-weight: 800; text-align: center; color: var(--ink-3); }
  .seg button.active { color: var(--buy-ink); background: linear-gradient(180deg, #6df0a4, var(--buy)); box-shadow: 0 2px 0 var(--buy-edge); }

  .track { height: 8px; margin-top: 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
  .track i, .ach-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--buy), var(--info)); }
  .ach-progress { height: 8px; margin: 10px 0; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
  kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; font: 800 12px var(--font); color: var(--ink); background: var(--plate-hi); box-shadow: 0 2px 0 var(--edge); }
  /* dock actions */
  .act { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: var(--dock-h); padding: 0 12px; overflow: hidden; border-radius: var(--r-md); transition: transform .08s, box-shadow .08s; }
  .act-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .22); }
  .act-ico svg { width: 17px; height: 17px; fill: currentColor; }
  .act-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
  .act-text b { font-size: 14px; font-weight: 900; }
  .act-sub { font-size: 12px; font-weight: 700; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .act-val { font-size: 16px; font-weight: 900; }
  .act-bar { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 5px; border-radius: 999px; background: rgba(0, 0, 0, .28); overflow: hidden; }
  .act-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: rgba(255, 255, 255, .8); }
  .act:active:not(:disabled) { transform: translateY(var(--depth)); }

  .act-overload { color: var(--hot-ink); background: linear-gradient(180deg, #ffb27a, var(--hot)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 var(--depth) 0 var(--hot-edge); }
  .act-overload:active:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 var(--hot-edge); }
  .act-overload.is-on { animation: surge 1s ease-in-out infinite alternate; }

  /* prestige stays dim until it is actually ready */
  .act-prestige { color: var(--ink-2); background: linear-gradient(180deg, var(--plate-hi), var(--plate)); box-shadow: inset 0 1px 0 var(--rim), 0 var(--depth) 0 var(--edge); }
  .act-prestige .act-ico { color: var(--core-text); }
  .act-prestige.is-on { color: var(--core-ink); background: linear-gradient(180deg, #c9b8ff, var(--core)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 var(--depth) 0 var(--core-edge), 0 0 22px rgba(167, 139, 255, .55); animation: ready 1.6s ease-in-out infinite alternate; }
  .act-prestige.is-on .act-ico { color: var(--core-ink); }
  /* production breakdown popover, anchored under the wallet */
  .breakdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; padding: 14px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--plate-hi), var(--plate)); box-shadow: inset 0 1px 0 var(--rim), 0 var(--depth) 0 var(--edge), var(--shadow-pop); }
  .bd-head, .bd-line, .bd-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .bd-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 800; color: var(--ink-2); }
  .bd-head b { font-size: 16px; color: var(--info-ink); }
  .bd-section { display: grid; gap: 4px; padding-top: 10px; }
  .bd-line { font-size: 13px; color: var(--ink-2); }
  .bd-line b, .bd-total b { color: var(--ink); }
  .bd-track { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
  .bd-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--buy), var(--info)); }
  .bd-sub { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); }
  .bd-mults { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-size: 13px; color: var(--ink-2); }
  .bd-mults b { text-align: right; color: var(--ink); }
  .bd-mults b.boost { color: var(--good-ink); }
  .bd-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
  .bd-total b { font-size: 17px; }
  .bd-note { margin-top: 6px; font-size: 12px; line-height: 1.55; color: var(--ink-3); }
  .bd-close { width: 100%; min-height: 40px; margin-top: 8px; border-radius: var(--r-md); font-size: 13px; font-weight: 800; text-align: center; color: var(--ink-2); background: rgba(255, 255, 255, .07); }
}
