:root {
  --ink: #1c1915;
  --paper: #f6f1e7;
  --line: #d9d0c2;
  --accent: #d84a24;
  --good: #1f6b45;
  --studio: #cfc6b8;
  --muted: #6f675e;
  --bar: 56px;
  color: var(--ink);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--studio);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--paper);
}
.word {
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.tabs { display: flex; background: #2a251f; border-radius: 999px; padding: 3px; }
.tabs button, .ghost, .solid, .review-btn {
  border: 0;
  background: transparent;
  color: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
}
.tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.grow { flex: 1; }
.version {
  font-variant-numeric: tabular-nums;
  color: #c8b8a4;
  font-size: 14px;
}
.ghost { border: 1px solid #5c5348; }
.solid { background: var(--accent); color: white; }
.review-btn { border: 1px solid var(--accent); color: #ffd2c4; }
.review-btn[aria-pressed="true"] { background: var(--accent); color: white; }

.stage { height: calc(100% - var(--bar)); position: relative; }
.frame {
  width: min(var(--view-w), calc(100% - 28px));
  height: calc(100% - 28px);
  margin: 14px auto;
  background: white;
  box-shadow: 0 16px 40px rgba(28, 25, 21, 0.18);
  position: relative;
}
.frame iframe { width: 100%; height: 100%; border: 0; background: white; display: block; }
body.phone .frame { width: 100%; height: calc(100% - 0px); margin: 0; box-shadow: none; }
body.phone .stage { height: calc(100% - var(--bar)); }

.overlay { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
.outline {
  position: fixed;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(216, 74, 36, 0.18);
  display: none;
}
.pin {
  position: fixed;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.pin.fixed { background: var(--good); }

.sheet, .modal, .signin, .portal, .denied {
  background: var(--paper);
  color: var(--ink);
}
.sheet {
  position: fixed;
  z-index: 30;
  top: calc(var(--bar) + 12px);
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--bar) - 24px);
  overflow: auto;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(28, 25, 21, 0.16);
  padding: 14px;
}
.sheet h2, .portal h1, .denied h1 { font-size: 22px; margin: 0 0 8px; }
.row { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; font-size: 15px; }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
input, select, textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 2px;
}
textarea { min-height: 88px; resize: vertical; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions button, .send {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
}
.actions .save, .send { background: var(--ink); color: var(--paper); }
.actions .cancel { background: transparent; border: 1px solid var(--line); }
.send:disabled { opacity: 0.45; }
.note {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 15px;
}
.note .meta { color: var(--muted); font-size: 13px; }
.fixed-tag { color: var(--good); font-weight: 700; }
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 21, 0.45);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal { width: min(460px, 100%); padding: 22px; border: 1px solid var(--line); }
.statement { font-size: 28px; line-height: 1.2; margin: 8px 0 12px; }
.signin, .portal, .denied {
  min-height: calc(100% - var(--bar));
  display: grid;
  place-items: center;
  padding: 24px;
}
.card { width: min(440px, 100%); }
.project-list { list-style: none; padding: 0; margin: 12px 0 0; }
.project-list a {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.empty { color: var(--muted); }
