/* W&T Studio home. Graphite + gold with the paper + terracotta twin (tokens.css). */
@import url("tokens.css");
:root { --ok: var(--st-published); --blue: var(--st-ready); }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
em { font-style: italic; color: var(--accent); }
.logo { display: block; width: 64px; aspect-ratio: 158 / 70; background: var(--accent);
  -webkit-mask: url(/img/wt-logo-mask.png) center / contain no-repeat; mask: url(/img/wt-logo-mask.png) center / contain no-repeat; }
.cap { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* ---------- top ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(22px, env(safe-area-inset-top)) 40px 22px; max-width: 1320px; margin: 0 auto; }
.top-right { display: flex; align-items: center; gap: 6px; }
.members { display: flex; align-items: center; margin-right: 6px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--sans); border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); margin-left: -8px; }
.av:first-child { margin-left: 0; }
.av.me { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); position: relative; z-index: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.icon-btn:hover { background: var(--panel); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.text-btn { height: 36px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.text-btn:hover { background: var(--panel); color: var(--text); }

.tg-link { display: inline-flex; align-items: center; gap: 8px; }
.tg-link svg { width: 17px; height: 17px; color: #2AABEE; }
.tg-link.on { color: var(--faint); }

/* ---------- hello ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 18px 40px 80px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 16px 0 36px; }
.hello h1 { margin: 0; font: 500 64px/1.02 var(--serif); letter-spacing: -.02em; }
.hello p { margin: 12px 0 0; color: var(--muted); font-size: 15px; min-height: 22px; }
.search { flex: none; width: 340px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--faint); cursor: pointer; transition: border-color var(--t) var(--ease); text-align: left; }
.search:hover { border-color: var(--line-strong); }
.search svg { width: 17px; height: 17px; }
.search kbd { margin-left: auto; font: 500 11px var(--sans); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 6px; color: var(--muted); }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 172px; gap: 16px; }
.tile { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: 22px; padding: 22px 24px; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background var(--t) var(--ease); }
a.tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.app-head { display: flex; align-items: center; gap: 12px; padding-right: 44px; min-width: 0; }
.mono { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); font: 600 22px/1 var(--serif); color: var(--accent); }
.tile h2 { margin: 0; font: 500 30px/1 var(--serif); }
.tile .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go { position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--muted); transition: all .25s var(--ease); }
.go svg { width: 16px; height: 16px; }
a.tile:hover .go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.planner { grid-column: span 2; grid-row: span 2; background: radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 55%), var(--panel); }
.planner-body { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.next-list { min-width: 0; }
.stats { display: flex; gap: 36px; margin: 18px 0 2px; }
.stat b { display: block; font: 500 46px/1 var(--serif); font-variant-numeric: lining-nums; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.now b { color: var(--accent); }
.next-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pill { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 6px; border-radius: 20px; background: var(--raised); border: 1px solid var(--line); max-width: 100%; }
.pill b { flex: none; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.later b { background: var(--sunken); color: var(--text); border: 1px solid var(--line-strong); }
.pill.quiet { color: var(--muted); padding-left: 16px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { border: 1px solid var(--line); border-radius: 12px; padding: 8px 9px 10px; background: var(--sunken); min-width: 0; }
.day .d { font-size: 11px; color: var(--faint); }
.day .n { font: 500 22px/1.1 var(--serif); font-variant-numeric: lining-nums; }
.day .dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; min-height: 6px; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.day .dots i.ok { background: var(--ok); }
.day .dots i.err { background: var(--st-error); }
.day.today { border-color: var(--accent); background: var(--accent-soft); }
.day.past { opacity: .72; }

.disk { grid-column: span 2; }
.meter { margin-top: auto; display: grid; gap: 8px; }
.meter .bar { height: 6px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .8s var(--ease); }
.meter .row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.activity { grid-column: span 2; }
.feed { margin-top: 12px; display: grid; gap: 10px; }
.feed .ev { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; min-width: 0; }
.feed .ev .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.feed b { color: var(--text); font-weight: 500; }
.feed time { margin-left: auto; flex: none; color: var(--faint); font-size: 12px; padding-left: 8px; }
.ev-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.ev-dot.gold { background: var(--accent); }
.ev-dot.blue { background: var(--blue); }
.feed .empty { color: var(--faint); }

.soon { border-style: dashed; background: transparent; }
.soon .mono { background: transparent; border-style: dashed; color: var(--faint); border-color: var(--line-strong); }
.soon h2 { font-size: 24px; color: var(--muted); }
.soon .sub, .link-tile .sub { margin-top: auto; white-space: normal; }
.link-tile h2 { font-size: 24px; }

.skeleton { color: transparent !important; background: linear-gradient(90deg, var(--raised), var(--sunken), var(--raised)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.off { color: var(--faint); font-size: 13px; }

.cal-mono { font-family: var(--serif); font-variant-numeric: lining-nums; }
.cal-next b { color: var(--text); font-weight: 600; }
.cal-more { color: var(--faint); }

/* ---------- command palette ---------- */
.palette { width: min(560px, calc(100vw - 32px)); max-width: none; margin: 14vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.palette::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 20px; font-size: 16px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow: auto; }
.palette li a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 11px; }
.palette li a .mono { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.palette li a small { margin-left: auto; color: var(--faint); font-size: 12px; }
.palette li.on a, .palette li a:hover { background: var(--raised); }

/* ---------- planners ---------- */
.planner { cursor: pointer; }
.planner:hover { border-color: var(--line-strong); }
.planner-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); font: 500 12.5px var(--sans); cursor: pointer; text-decoration: none; }
.pl-chip:hover { border-color: var(--accent-line); }
.pl-chip.add { color: var(--accent); border-style: dashed; background: transparent; }
.pl-chip .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.pl-chip.err { color: var(--st-error); }
@keyframes spin { to { transform: rotate(360deg); } }
.np-field { display: grid; gap: 6px; }
.np-field span { font-size: 12px; color: var(--muted); }
.np-field input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); padding: 0 12px; font: inherit; outline: none; }
.np-field input:focus { border-color: var(--accent-line); }
.np-url { font-size: 13px; }
.np-url b { color: var(--text); font-weight: 500; }
.np-err { color: var(--st-error) !important; font-size: 13px; min-height: 0; }
.np-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- invite ---------- */
.invite-body { display: grid; gap: 14px; padding: 26px 24px 18px; }
.invite-body h3 { margin: 0; font: 500 28px/1.1 var(--serif); }
.invite-body p { margin: 0; color: var(--muted); line-height: 1.5; }
.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; min-width: 0; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); padding: 0 12px; font: inherit; font-size: 13px; }
.invite-copy { height: 42px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.invite-body .text-btn { justify-self: end; }

@media (max-width: 1000px) {
  #invite-btn { display: none; }
  .tg-link span { display: none; }
  .top, .wrap { padding-left: 16px; padding-right: 16px; }
  .top { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: 16px; }
  .hello { flex-direction: column; align-items: stretch; margin-top: 8px; }
  .hello h1 { font-size: 44px; }
  .search { width: 100%; }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(150px, auto); gap: 10px; }
  .planner, .disk, .activity { grid-column: span 2; }
  .planner { grid-row: auto; min-height: 330px; }
  .tile { padding: 18px; }
  .go { top: 18px; right: 18px; }
  .week { gap: 4px; }
  .stats { gap: 22px; margin-top: 14px; }
  .stat b { font-size: 36px; }
  .day { padding: 6px 2px 8px; text-align: center; }
  .day .dots { justify-content: center; }
  .members { display: none; }
}

/* ---------- installable app ---------- */
.install-btn { color: var(--accent); }
.ios-hint { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; width: min(380px, calc(100vw - 24px));
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 14px 14px 14px 12px; border-radius: 16px;
  background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.4; }
.ios-hint img { width: 44px; height: 44px; border-radius: 11px; }
.ios-hint b { font-weight: 600; }
.ios-hint button { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
@media (display-mode: standalone) { .install-btn { display: none !important; } }
