:root {
  --ink: #172522;
  --forest: #173b35;
  --mint: #dce9df;
  --paper: #f4f1e8;
  --white: #fffdf8;
  --coral: #d95f42;
  --blue: #246b8e;
  --amber: #b47716;
  --muted: #68736f;
  --line: #d6d5cc;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(23, 59, 53, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 59, 53, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: "IBM Plex Sans JP", sans-serif;
}
button, a { font: inherit; }

.topbar {
  min-height: 68px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--forest);
}
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font: 750 23px Fraunces, serif; }
.brand-mark { width: 25px; height: 25px; border: 6px solid var(--coral); border-right-color: var(--mint); transform: rotate(45deg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: white; border: 1px solid rgba(255,255,255,.35); }
.icon-button svg, .command svg { width: 18px; height: 18px; flex: 0 0 auto; }

main { width:min(1280px,100%); margin:0 auto; padding:0 0 72px; }
.command { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; color: white; background: var(--coral); border: 0; cursor: pointer; font-weight: 700; text-decoration: none; }
.command:disabled { opacity: .55; cursor: wait; }
.command.is-loading svg { animation: spin 1s linear infinite; }
.sync-command { min-height:38px; padding:6px 12px; }

.athlete-tabs { display:flex; align-items:center; padding:3px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.25); }
.athlete-tab { min-width:48px; min-height:30px; padding:4px 10px; color:var(--mint); background:transparent; border:0; cursor:pointer; font-size:13px; font-weight:600; }
.athlete-tab[aria-selected="true"] { color:var(--forest); background:var(--white); }

.status { min-height: 240px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.status svg { animation: spin 1s linear infinite; }
.dashboard-view { animation: reveal .35s ease-out both; }
.dashboard-view iframe { display: block; width: 100%; min-height: 720px; border: 0; background: var(--paper); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .topbar { min-height:60px; padding:0 10px; gap:8px; }
  .brand { gap:7px; font-size:19px; }
  .brand-mark { width:20px; height:20px; border-width:5px; }
  .topbar-actions { gap:6px; }
  #account-name { display: none; }
  .athlete-tab { min-width:40px; padding:4px 7px; white-space:nowrap; }
  .sync-command { width:38px; min-height:38px; padding:0; justify-content:center; }
  .sync-command span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .icon-button { width:38px; height:38px; }
  .dashboard-view iframe { min-height: 620px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}