/* Members app styles. Brand tokens are set per org on :root by the page shell. */

:root {
  --serif: Georgia, "Times New Roman", serif;
  --display: Sancreek, Georgia, serif;
  --sans: Barlow, Arial, sans-serif;
  --pad: 20px;
  --header-h: 64px;
  --tab-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
}
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; font-weight: 700; line-height: 1.05; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { font-size: 15px; line-height: 1.5; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.phone-only { display: inherit; }
.desktop-only { display: none !important; }

/* Header */
.app-header {
  /* Installed on a phone, the status bar sits inside the top safe area: pad the header below it. */
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  flex-shrink: 0;
  padding: env(safe-area-inset-top, 0px) var(--pad) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--black);
  color: #F6F1ED;
  border-bottom: 2px solid var(--accent);
}
.app-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-header .back { display: flex; color: #F6F1ED; padding: 6px; margin-left: -6px; }
.app-header .brand img { height: 32px; width: auto; }
.header-label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.header-label.accent { color: var(--accent); }
.top-nav { display: none; }

.sample-banner { padding: 10px var(--pad); background: var(--accent); color: var(--black); font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-align: center; }

/* Main */
.app-main {
  flex: 1 0 auto;
  width: 100%;
  padding: 24px var(--pad) 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.shell-member .app-main, .shell-admin .app-main { padding-bottom: calc(32px + var(--tab-h) + env(safe-area-inset-bottom)); }
.app-main > * { min-width: 0; }
.card, .note, .notice, .list .row { min-width: 0; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-tight { display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 560px; }
.wide { max-width: 1100px; }

.app-footer { flex-shrink: 0; padding: 20px 24px; display: flex; justify-content: center; background: var(--black); font-size: 12px; color: var(--muted); }

/* Tab bar (phone) */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 0 12px env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: var(--black);
  z-index: 20;
}
.tab-bar a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; text-decoration: none; color: #F6F1ED; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.tab-bar a.current { color: var(--accent); }

/* Type helpers */
.label { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.label-small { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.meta { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--subtle); }
.subtle { color: var(--subtle); font-size: 13px; line-height: 1.45; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.empty { color: var(--ink); }
.small-text { font-size: 14px; color: var(--subtle); line-height: 1.5; }

/* Links and buttons */
.link-rule { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 2px; align-self: flex-start; }
.link-rule.small { font-size: 11px; }
.link-raw { font-size: 12px; line-height: 1.5; color: var(--subtle); word-break: break-all; overflow-wrap: anywhere; }
.as-button { background: none; border: 0; border-bottom: 2px solid var(--accent); padding: 0 0 2px; cursor: pointer; font: inherit; font-family: var(--sans); }
.btn { display: inline-block; font-family: var(--sans); font-size: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; text-decoration: none; color: var(--black); background: var(--accent); padding: 16px 24px; border: 0; border-radius: 0; cursor: pointer; line-height: normal; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-outline { color: var(--ink); background: #fff; border: 2px solid var(--ink); padding: 10px 14px; font-size: 13px; }
.btn-quiet { color: var(--ink); background: transparent; border: 2px solid var(--muted); padding: 10px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

/* Forms */
form.stack { gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.req { color: var(--accent); margin-left: 3px; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; margin: 0; padding: 0 12px;
  font-family: var(--serif); font-size: 15px; color: var(--ink);
  background: #fff; border: 2px solid var(--muted); border-radius: 0;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field select { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%23141413' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M2 2l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); }
.field .help { font-size: 13px; color: var(--subtle); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 16px; flex-wrap: wrap; }
.login-form .field input { height: 52px; padding: 0 16px; font-size: 17px; }

/* Cards */
.card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border: 1px solid var(--rule); }
.card-accent { border: 2px solid var(--rule); border-top: 4px solid var(--accent); }
.card-strong { border: 2px solid var(--ink); }
.card-dark { background: var(--black); color: #F6F1ED; border: 0; padding: 12px 16px; gap: 4px; }
.card-dark a { color: #F6F1ED; text-decoration: none; border-bottom: 1px solid var(--muted); }
.card-dark .subtle { color: var(--muted); }
.card h2 { font-size: 22px; }
.card .card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card-section { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rule); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--ink); padding: 3px 7px; }

/* Tabs */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tabs a { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 10px 2px; border-bottom: 3px solid transparent; color: var(--subtle); white-space: nowrap; }
.tabs a.current { border-bottom-color: var(--accent); color: var(--ink); }

/* Notes */
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: #fff; border: 1px solid var(--rule); }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--subtle); }
.note p { font-size: 15px; line-height: 1.5; white-space: pre-line; }
.note-log { display: flex; flex-direction: column; gap: 8px; }
.note-log .entry { display: flex; flex-direction: column; gap: 2px; }
.note-log .entry p { font-size: 14px; line-height: 1.45; }

/* Lists and tables */
.list { display: flex; flex-direction: column; }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.list .row .primary { font-size: 16px; }
.list .row .secondary { font-size: 13px; color: var(--subtle); }
.list .row .right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.status { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 7px; border: 1px solid var(--ink); }
.status-paused, .status-past { color: var(--subtle); border-color: var(--muted); }
.status-ok { border-color: var(--accent); color: var(--accent); }
.status-fail { background: var(--ink); color: #F6F1ED; border-color: var(--ink); }
.status-skip { color: var(--subtle); border-color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule); }
table.data td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

.notice { padding: 12px 16px; background: #fff; border: 2px solid var(--accent); font-size: 15px; }
.notice-warn { border-color: var(--ink); }

/* Embeds on the All notes page */
.embed { width: 100%; height: 70vh; border: 1px solid var(--rule); background: #fff; }

/* Login */
.login-mark { display: flex; justify-content: center; }
.login-mark img { width: 120px; height: 160px; object-fit: contain; }
.login-aside { display: none; }

/* Wizard */
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.steps span { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.steps span.current { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.two-col { display: flex; flex-direction: column; gap: 20px; }

@media (min-width: 900px) {
  :root { --pad: 56px; --header-h: 80px; }
  .phone-only { display: none !important; }
  .desktop-only { display: inherit !important; }
  .app-header .brand img { height: 40px; }
  .app-header .back { display: none; }
  .top-nav { display: flex !important; align-items: center; gap: 36px; }
  .top-nav a { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: #F6F1ED; }
  .top-nav a.current { color: var(--accent); }
  .app-header > .header-label.phone-only { display: none !important; }
  .app-main { padding: 40px var(--pad) 56px; max-width: 1280px; margin: 0 auto; }
  .shell-member .app-main, .shell-admin .app-main { padding-bottom: 56px; }
  h1 { font-size: 40px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 48px; align-items: start; }
  .two-col.narrow-side { grid-template-columns: 300px minmax(0, 1fr); }
  .btn.btn-fit { width: auto; align-self: flex-start; }
  /* Login: black aside with the mark, form on the right */
  .login-layout { display: grid; grid-template-columns: minmax(0, 1fr) 560px; min-height: calc(100vh - var(--header-h) - 96px); }
  .login-aside { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; padding: 56px; margin: 0 24px 0 0; background: var(--black); color: #F6F1ED; text-align: center; border-top: 4px solid var(--accent); }
  .login-aside img { width: 240px; height: 320px; object-fit: contain; }
  .login-aside h2 { font-size: 34px; line-height: 1.1; }
  .login-panel { padding: 72px 64px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
  .login-panel h1 { font-size: 44px; }
  .login-panel p.intro { font-size: 18px; }
  .login-mark { display: none; }
  .login-panel .btn { align-self: flex-start; padding: 16px 36px; }
}
