/* Tara? components. Tokens only (see tokens.css); class names match _private/design/screens.html. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1, h2 { font: 800 24px/1.15 var(--sans); margin: 0; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
a { color: inherit; }

/* Cards */
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 14px;
  margin: 0 3px 3px 0;
}
.sticker {
  background: var(--hero-bg);
  color: var(--hero-fg);
  border: 2px solid var(--hero-fg);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 16px;
  margin: 0 5px 5px 0;
}

/* Suggestion content */
.from { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 600 14px/1.2 var(--sans); color: var(--hero-muted); }
.av {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  font: 700 11px/1 var(--sans);
  background: var(--hero-fg); color: var(--hero-bg); border: 2px solid var(--hero-fg);
}
.av.out { background: var(--hero-bg); color: var(--hero-muted); border: 2px dashed var(--hero-muted); }
.ask { font: 800 40px/1 var(--sans); color: var(--hero-accent); margin: 0 0 6px; }
.when { margin: 0; font: 800 46px/1 var(--sans); font-variant-numeric: tabular-nums; }
.when small { font-size: 22px; margin-left: 4px; }
.card .when { font-size: 30px; }
.card .when small { font-size: 16px; }
.day { margin: 6px 0 0; font-size: 16px; font-weight: 600; }
.others { margin: 4px 0 0; font-size: 14px; color: var(--hero-muted); }
.card .others { color: var(--muted); }
.tally { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.avs { display: flex; padding-left: 6px; }
.avs .av { margin-left: -6px; }
.count { margin: 0; font: 700 16px/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.count span { display: block; font-weight: 400; font-size: 14px; color: var(--hero-muted); }
.card .count span { color: var(--muted); }
.card > .count { margin-top: 6px; }
.sticker > .stack { margin-top: 14px; }
.votes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }

/* Buttons (button.btn and a.btn look the same) */
.btn {
  font: 600 16px/1.1 var(--sans);
  min-height: 48px;
  min-width: 44px;
  padding: 0 16px;
  margin: 0;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 120ms ease;
}
/* On the yellow sticker, plain buttons are yellow with a black outline in both themes. */
.sticker .btn { background: var(--hero-bg); color: var(--hero-fg); border-color: var(--hero-fg); }
.btn.primary, .btn[aria-pressed="true"] { background: var(--accent-ink); color: var(--on-accent); border-color: var(--accent-ink); }
.btn.quiet {
  min-height: 44px;
  box-shadow: none;
  border-width: 0;
  background: transparent;
  padding: 0 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-content: flex-start;
}
.sticker .btn.quiet { color: var(--hero-fg); }
/* On the yellow sticker, chosen and primary buttons are black with yellow text in both themes. */
.sticker .btn.primary, .sticker .btn[aria-pressed="true"] { background: var(--hero-fg); color: var(--hero-bg); border-color: var(--hero-fg); }
@media (hover: hover) {
  .btn:hover { opacity: .85; }
}

/* Layout helpers */
.stack { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row b { font: 800 20px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.row .fit { color: var(--muted); font-size: 14px; }

/* Forms */
label { display: block; font-weight: 600; margin: 0 0 4px; }
input, select, textarea, .input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  font: 400 16px var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
}
.input { display: flex; align-items: center; }
textarea { padding: 10px 12px; line-height: 1.4; resize: vertical; }
input::placeholder { color: var(--muted); opacity: 1; }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Right now list */
.now { padding: 0; }
.now h3 { margin: 0; padding: 10px 12px; font: 700 15px/1.2 var(--sans); }
.now ul { margin: 0; padding: 0; list-style: none; }
.now li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-top: 2px solid var(--line); }
.now .p { margin: 0; font-weight: 600; }
.now .p span { font-weight: 400; color: var(--muted); }
.now .t { font: 500 15px/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.now .s { display: block; margin-top: 4px; font: 600 12px/1 var(--sans); color: var(--muted); }
.now .s.awake { color: var(--accent-ink); }

/* Bottom sheet: <dialog class="sheet"> */
dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  margin: 0 auto;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-top: 2px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 18px 16px 24px;
}
dialog.sheet[open] { display: flex; flex-direction: column; gap: 10px; }
dialog.sheet::backdrop { background: color-mix(in srgb, var(--shadow) 55%, transparent); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Misc */
.icon { width: 20px; height: 20px; flex: none; }
.foot { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: auto; }
.note { margin: 0; font-size: 14px; color: var(--muted); }

/* Focus */
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sticker :focus-visible { outline-color: var(--hero-accent); }
