/* WeekClose Punch. Contrast ratios are checked in tests/contrast.test.js (WCAG 2.1 AA: 4.5:1 text, 3:1 UI). */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #14181f;
  --muted: #47505e;
  --line: #c9ced6;
  --in-bg: #0a5c36;     /* white text 7.6:1 */
  --in-text: #ffffff;
  --out-bg: #1f2a44;    /* white text 14:1 */
  --out-text: #ffffff;
  --cb-bg: #ffffff;
  --cb-text: #1f2a44;
  --focus: #b45309;
  --ok-bg: #e7f4ec;
  --ok-text: #0a4a2c;
  --warn-bg: #fff4e0;
  --warn-text: #6b3a00;
  --link: #1d4ed8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --card: #1a1f26;
    --text: #f1f3f6;
    --muted: #b9c0cb;
    --line: #3b4452;
    --in-bg: #5fd59a;   /* dark text 10:1 */
    --in-text: #06240f;
    --out-bg: #9fb6e8;  /* dark text 9.5:1 */
    --out-text: #0c1425;
    --cb-bg: #1a1f26;
    --cb-text: #dbe4f7;
    --focus: #fbbf24;
    --ok-bg: #12321f;
    --ok-text: #b8f0cf;
    --warn-bg: #3a2a0c;
    --warn-text: #ffe2a8;
    --link: #93b4ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
}
header.top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
header.top img { width: 2.5rem; height: 2.5rem; border-radius: .6rem; flex: none; }
header.top .org { font-weight: 700; font-size: 1.125rem; line-height: 1.25; }
header.top .app { color: var(--muted); font-size: .95rem; }

h1, h2 { line-height: 1.2; margin: 0 0 .75rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.hello { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; }
.hello .who { font-size: 1.3rem; font-weight: 700; }
.last { font-size: 1.05rem; }
.last strong { font-weight: 700; }
.last.none { color: var(--muted); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%;
  min-height: 3.25rem;               /* 52px */
  padding: .75rem 1rem;
  border-radius: .9rem;
  border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1.15rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 1.6em; height: 1.6em; flex: none; }
.btn.big { min-height: 6rem; font-size: 1.6rem; border-radius: 1.1rem; margin-bottom: 1rem; }
.btn.in { background: var(--in-bg); color: var(--in-text); }
.btn.out { background: var(--out-bg); color: var(--out-text); }
.btn.cb, .btn.plain { background: var(--cb-bg); color: var(--cb-text); border-color: currentColor; }
.btn.suggested { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px currentColor; }
.btn.in.suggested { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--in-bg); }
.btn.out.suggested { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--out-bg); }
.btn:active { transform: scale(.985); }
.btn .sub { display: block; font-weight: 400; font-size: .95rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.linkbtn {
  background: none; border: 0; padding: .75rem .25rem; min-height: 3rem; min-width: 3rem;
  font: inherit; color: var(--link); text-decoration: underline; cursor: pointer;
}
a { color: var(--link); }
a.linkbtn { display: inline-flex; align-items: center; }

label { display: block; font-weight: 700; margin: 0 0 .35rem; }
.hint { color: var(--muted); font-size: 1rem; margin: -.1rem 0 .5rem; }
input, select {
  width: 100%;
  min-height: 3.25rem;
  padding: .6rem .8rem;
  font: inherit; font-size: 1.15rem;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--muted);
  border-radius: .7rem;
  margin-bottom: 1rem;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 22rem) { .row2 { grid-template-columns: 1fr; } }

.notice { border-radius: .8rem; padding: .8rem 1rem; margin-bottom: 1rem; }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice ul { margin: .25rem 0 0; padding-left: 1.2rem; }

.steps { padding-left: 1.4rem; margin: 0 0 1rem; }
.steps li { margin-bottom: .4rem; }
.big-step { font-size: 1.35rem; font-weight: 700; }

.footer { color: var(--muted); font-size: .95rem; margin-top: 1.5rem; }
.footer p { margin-bottom: .5rem; }
.stack > * + * { margin-top: .75rem; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }
