/* doitdaniel screens. Tokens and shapes from docs/reviews/screens-round-1/mockup-round-1.html:
   every tappable control is 40px tall with 4px corners, header controls on one line. */
:root {
  color-scheme: light;
  --bg: #f3f5f7; --panel: #fff; --ink: #16212b; --dim: #5b6a76; --line: #d5dce2;
  --macc: #0b6e6e; --macc-ink: #fff; --macc-soft: #dcefee; --mwarn: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10171d; --panel: #182128; --ink: #e6edf2; --dim: #9aaab6; --line: #2a3640;
    --macc: #5cc4c0; --macc-ink: #0b1a1a; --macc-soft: #17322f; --mwarn: #e8bd68;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10171d; --panel: #182128; --ink: #e6edf2; --dim: #9aaab6; --line: #2a3640;
  --macc: #5cc4c0; --macc-ink: #0b1a1a; --macc-soft: #17322f; --mwarn: #e8bd68;
}

*, *::before, *::after { box-sizing: border-box; }

/* App shell: the page itself never scrolls or bounces; only the content area scrolls. */
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.shell { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); container: shell / inline-size; }

.m-top {
  flex: none; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.m-top .brand { font-weight: 700; letter-spacing: -.01em; flex: none; }
.m-top .who { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; }
.m-top .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 14px; min-width: 0; }
form.inline { display: contents; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.m-body {
  max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.m-body h2 { margin: 0; font-size: 22px; line-height: 1.2; text-wrap: balance; }
.m-body p { margin: 0; max-width: 62ch; }
.dim { color: var(--dim); }
.small { font-size: 14px; }

/* Controls: one height (40px), one shape (4px rectangle). */
.m-btn {
  height: 40px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap; flex: none;
}
.m-btn.pri { background: var(--macc); border-color: var(--macc); color: var(--macc-ink); font-weight: 600; }
.m-btn.sq { width: 40px; padding: 0; }
.m-btn[disabled] { opacity: .6; cursor: progress; }
.m-in {
  height: 40px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  /* 16px stops iPhone Safari zooming in when a field is tapped */
  font: inherit; font-size: 16px; padding: 0 10px;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { height: 38px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--macc); color: var(--macc-ink); }

.m-btn:focus-visible, .seg button:focus-visible, .tile:focus-visible, .m-in:focus-visible, .appbtn:focus-visible {
  outline: 2px solid var(--macc); outline-offset: 2px;
}

.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Home */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 16px;
}
.tile .ic { color: var(--macc); width: 26px; height: 26px; }
.tile .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile b { font-size: 16px; }
.tile .d { color: var(--dim); font-size: 14px; }
.tile .role { color: var(--dim); font-size: 14px; }

/* No access */
.addr { font: 14px ui-monospace, Menlo, monospace; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; background: var(--panel); align-self: flex-start; overflow-wrap: anywhere; }

/* Owner screen */
/* Room for two lines is kept free, so a message appearing never pushes the page down. */
.m-body .m-status { min-height: calc(2 * 1.45em); max-width: none; font-size: 14px; color: var(--dim); }
/* On a phone the message stays in view at the top while you work further down the list. */
.m-body .m-status { position: sticky; top: 0; z-index: 1; margin: -8px -16px; padding: 8px 16px; pointer-events: none; }
.m-body .m-status:not(:empty) { background: var(--bg); }
.m-status.err { color: var(--mwarn); }
.owner { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
@container shell (max-width: 600px) { .owner { grid-template-columns: minmax(0, 1fr); } }
.applist { display: flex; flex-direction: column; gap: 8px; }
.appbtn {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); border-radius: 6px; text-decoration: none;
}
.appbtn[aria-current="true"] { border-color: var(--macc); box-shadow: 0 0 0 1px var(--macc); }
.appbtn .ic { color: var(--macc); }
.appbtn .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt { font-size: 14px; color: var(--dim); }
.panel2 { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel2 h2 { font-size: 20px; }
.people { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; gap: 8px; align-items: center; }
.prow .e { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prow select { width: 110px; flex: none; }
/* The private/public note keeps two lines of room, so flipping the switch never moves the list below. */
#p-visnote { min-height: calc(2 * 1.45em); }
.pubrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.addrow .m-in[type="email"] { flex: 1 1 200px; min-width: 0; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
