/* PS Desk design system: native iOS feel. One file for every screen.
   Pages keep their existing class names (card, row, btn, ghost, pill...). */

:root {
  --bg: #f2f2f7; --card: #ffffff; --ink: #1c1c1e; --muted: #6e6e73; --line: #e5e5ea; --fill: #f2f2f7;
  --accent: #4f46e5; --accent-ink: #ffffff; --accent-soft: #eef0ff;
  --high: #d70015; --high-soft: #ffe9eb; --normal: #b25000; --normal-soft: #fff1e0;
  --low: #6e6e73; --low-soft: #efeff4; --ok: #248a3d; --ok-soft: #e4f6e8; --ok-ink: #ffffff;
  --bar: rgba(249, 249, 252, .86); --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --radius: 18px;
  color-scheme: light;  /* always the light grey theme, even when the phone is in dark mode */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 780px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 104px);
}
[hidden] { display: none !important; }
a { color: var(--accent); }

/* ---------- Header: large title + gear ---------- */
.app-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 18px; }
.app-header h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 800; }
.app-header .sub { color: var(--muted); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow); flex: none;
}
.icon-btn svg { width: 22px; height: 22px; }
body[data-title] main > nav, body[data-title] main > h1 { display: none; } /* app pages: app.js draws these */

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 12px;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.on { color: var(--accent); }
.tabbar .badge {
  position: absolute; margin: -2px 0 0 22px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--high); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.tabbar .ico { position: relative; display: grid; }

/* ---------- Cards and text ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow); border: 0;
}
.section-title, h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 10px;
}
h2 { font-size: 22px; letter-spacing: -.01em; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
details { margin-top: 12px; }
summary { color: var(--accent); cursor: pointer; font-weight: 600; font-size: 15px; }
ul.points, ol { margin: 0; padding-left: 22px; }
ul.points li, ol li { margin: 4px 0; }

/* ---------- Inputs ---------- */
textarea, input, select {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid transparent; background: var(--fill); color: var(--ink); outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); background: var(--card); }
textarea { min-height: 120px; resize: vertical; }
input[type=date], input[type=time] { width: auto; }

/* ---------- Buttons ---------- */
button, a.btn, label.btn {
  font: inherit; font-weight: 600; font-size: 16px; border: 0; border-radius: 12px; padding: 11px 18px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; transition: transform .08s, opacity .15s;
}
button:active, a.btn:active, label.btn:active { transform: scale(.97); }
button:disabled { opacity: .5; }
button.ghost, button.secondary, label.btn.ghost { background: var(--accent-soft); color: var(--accent); }
button.ok { background: var(--ok); color: var(--ok-ink); }
button[data-a=discard] { background: transparent; color: var(--high); }
button.rec { background: var(--high); color: #fff; }
button.link { background: transparent; color: var(--accent); padding: 8px; }

/* ---------- Segmented control (Tasks: To approve / Approved) ---------- */
.tabs { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.tabs button { flex: 1; background: transparent; color: var(--ink); font-size: 15px; padding: 8px; border-radius: 10px; }
#q { margin-bottom: 12px; }
.tabs button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Task items ---------- */
.task { border-top: .5px solid var(--line); padding: 14px 0; }
.task:first-child { border-top: 0; padding-top: 2px; }
.task strong { font-size: 17px; display: block; margin: 6px 0 2px; }
ul.log { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
ul.log li { padding: 3px 0; display: flex; gap: 10px; }
ul.log li span:first-child { flex: none; width: 104px; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; vertical-align: 1px;
}
.pill.high { color: var(--high); background: var(--high-soft); }
.pill.normal { color: var(--normal); background: var(--normal-soft); }
.pill.low { color: var(--low); background: var(--low-soft); }
.edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.edit .full { grid-column: 1 / -1; }

/* ---------- Lists (meetings) ---------- */
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { padding: 12px 0; border-top: .5px solid var(--line); cursor: pointer; }
ul.list li:first-child { border-top: 0; }

/* ---------- Status text ---------- */
.state { font-size: 14px; font-weight: 700; }
.state.on { color: var(--ok); } .state.off { color: var(--muted); }
.msg.bad { color: var(--high); } .msg.good { color: var(--ok); }

@media (min-width: 900px) {
  main { max-width: 860px; }
  .app-header h1 { font-size: 40px; }
}
