/* SignYeah - iOS 6 chrome. Mirrors apps/portfolio/site/assets/tokens.css (separate Worker, so inlined here). */
:root {
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --tap: 44px;
  --ink: #1b1d22;
  --ink-soft: #4b5060;
  --nav-top: #b0c4de;
  --nav-mid: #6d8cb5;
  --nav-bot: #3f5f8f;
  --nav-edge: #21385c;
  --blue-top: #6fa6f2;
  --blue-mid: #2e6fd6;
  --blue-bot: #1c4fa8;
  --blue-edge: #173f85;
  --grey-top: #fdfdfd;
  --grey-mid: #e4e6ea;
  --grey-bot: #c9ccd3;
  --grey-edge: #8d919b;
  --group-edge: #9a9ea8;
  --sep: #d3d6dc;
  --pin-a: #c7cbd4;
  --pin-b: #c2c6cf;
  --paper: #fffef8;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.stage {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.06), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px),
    #23262b;
}
.phone {
  width: 100%;
  max-width: 412px;
  padding: 46px 11px 58px;
  border-radius: 44px;
  position: relative;
  background: linear-gradient(180deg, #2a2b2e, #0c0d0f 30%, #050506);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.25), inset 0 0 0 2px #38393d;
}
.phone::before {
  content: ""; position: absolute; top: 20px; left: 50%; width: 56px; height: 6px; margin-left: -28px;
  border-radius: 3px; background: #1b1c1f;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.08);
}
.phone::after {
  content: ""; position: absolute; bottom: 8px; left: 50%; width: 42px; height: 42px; margin-left: -21px;
  border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2c2d31, #0a0a0c 70%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.18), 0 0 0 2px #1a1b1e;
}
.screen {
  height: min(100dvh - 152px, 760px);
  display: flex; flex-direction: column;
  border-radius: 4px; overflow: hidden;
  background: #c4c8d1;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6);
}
.statusbar {
  flex: none; height: 21px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 8px; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0.2px;
  background: linear-gradient(180deg, #4a4c52, #111216 50%, #000);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.8);
}
.sb-left { display: inline-flex; align-items: center; gap: 5px; }
.sb-right { display: inline-flex; justify-content: flex-end; align-items: center; }
.nav {
  flex: none;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  height: 44px; padding: 0 8px;
  background: linear-gradient(180deg, var(--nav-top), var(--nav-mid) 50%, var(--nav-bot));
  border-bottom: 1px solid var(--nav-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.nav-title {
  grid-column: 2; margin: 0; text-align: center;
  font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 0.2px;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-back, .nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 9px;
  font-size: 13px; font-weight: 700; color: #fff; text-decoration: none;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.6);
  background: linear-gradient(180deg, #8ba7cc, #56759f 50%, #3a5480);
  border: 1px solid var(--nav-edge); border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  font-family: var(--font); cursor: pointer;
}
.nav-back {
  position: relative; z-index: 1; margin-left: 8px; padding-left: 6px;
  border-left: 0; border-radius: 0 5px 5px 0;
}
.nav-back::before {
  content: ""; position: absolute; z-index: -1; left: -11px; top: 3.5px;
  width: 21px; height: 21px; transform: rotate(45deg);
  background: linear-gradient(135deg, #8ba7cc, #56759f 50%, #3a5480);
  border: 1px solid var(--nav-edge); border-right: 0; border-top: 0;
  border-radius: 4px 0 0 0;
}
.nav-btn.upload { grid-column: 3; position: relative; overflow: hidden; }
.nav-btn.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.sheet {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: repeating-linear-gradient(90deg, var(--pin-a) 0 2px, var(--pin-b) 2px 4px);
}
.page { padding: 14px 12px 28px; }
.lede {
  margin: 0 0 14px; text-align: center; font-size: 14px; line-height: 1.4;
  color: var(--ink-soft); text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.lede strong { color: var(--ink); }

/* Grouped tables */
.group-title {
  margin: 14px 12px 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
  color: #4c5a72; text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.group-foot { margin: 6px 12px 0; font-size: 12px; line-height: 1.35; color: #5d6474; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
.group {
  margin: 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid var(--group-edge); border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7), inset 0 1px 0 #fff;
  overflow: hidden;
}
.group-row {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0 12px;
  border-bottom: 1px solid var(--sep); font-size: 16px; color: var(--ink);
  width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0;
  font-family: var(--font); text-decoration: none; margin: 0;
}
.group-row:last-child { border-bottom: 0; }
.group-row.field span { flex: none; width: 84px; font-weight: 700; font-size: 15px; }
.group-row.field input {
  flex: 1; min-width: 0; min-height: var(--tap);
  border: 0; outline: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink);
}
.group-row.field input::placeholder { color: #a5aab5; }

/* Documents list: app.js renders <li><button>title (status)</button></li> */
.docs li { list-style: none; border-bottom: 1px solid var(--sep); }
.docs li:last-child { border-bottom: 0; }
.docs button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--tap); padding: 0 12px 0 44px; position: relative;
  border: 0; background: transparent; text-align: left;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.docs button::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 22px; margin-top: -11px;
  background: linear-gradient(180deg, #fff, #eceff3); border: 1px solid #9aa0ab; border-radius: 2px;
  box-shadow: inset 0 0 0 2px #fff, 4px 6px 0 -3px #c9cdd6 inset;
}
.docs button::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 3px solid #8b909b; border-bottom: 3px solid #8b909b; transform: rotate(-45deg);
}
.docs button:active { background: linear-gradient(180deg, #4e8ff0, #1e5fd0); color: #fff; }
.docs:empty { display: none; }
.docs:not(:empty) + .group-foot { display: none; }

/* Editor */
.editor { margin-top: 18px; }
.editor h2 {
  margin: 0 12px 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: #4c5a72; text-shadow: 0 1px 0 rgba(255,255,255,0.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toolbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 0 12px; border: 1px solid var(--nav-edge); border-radius: 7px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 1px 0 rgba(255,255,255,0.6);
}
.toolbar button {
  min-height: 34px; border: 0; border-right: 1px solid var(--nav-edge);
  background: linear-gradient(180deg, #a9bdd9, #6d8cb5 50%, #4a6a99);
  color: #fff; font: inherit; font-size: 13px; font-weight: 700;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.5); cursor: pointer;
}
.toolbar button:last-child { border-right: 0; }
.toolbar button.active {
  background: linear-gradient(180deg, #2c4a78, #3f5f8f);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.45);
}
.paper {
  padding: 10px; margin: 0 0 8px;
  background: linear-gradient(180deg, #5b6068, #3f434b);
  border: 1px solid #23262b; border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 0 rgba(255,255,255,0.5);
}
#page, #draw {
  display: block; width: 100%; height: auto;
  background: var(--paper); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 3px 8px rgba(0,0,0,0.45);
  touch-action: none;
}
#draw {
  background:
    linear-gradient(180deg, transparent calc(100% - 36px), #b9bec9 calc(100% - 36px), #b9bec9 calc(100% - 35px), transparent calc(100% - 35px)),
    var(--paper);
}
.hint { margin: 0 12px 6px; font-size: 12px; text-align: center; color: #5d6474; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }

/* Buttons */
.btn, .primary, .secondary {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 14px 0 0; min-height: var(--tap); padding: 0 14px;
  border-radius: 9px; font: inherit; font-size: 17px; font-weight: 700; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 1px 1px rgba(0,0,0,0.3);
  cursor: pointer;
}
.primary {
  border: 1px solid var(--blue-edge); color: #fff;
  background: linear-gradient(180deg, var(--blue-top), var(--blue-mid) 52%, var(--blue-bot));
  text-shadow: 0 -1px 0 rgba(0,0,0,0.45);
}
.primary:active { background: linear-gradient(180deg, var(--blue-bot), var(--blue-mid)); box-shadow: inset 0 2px 4px rgba(0,0,0,0.35); }
.secondary {
  border: 1px solid var(--grey-edge); color: var(--ink);
  background: linear-gradient(180deg, var(--grey-top), var(--grey-mid) 52%, var(--grey-bot));
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.secondary:active { background: linear-gradient(180deg, var(--grey-bot), var(--grey-mid)); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .primary, .btn-row .secondary { margin-top: 10px; }

.link-out {
  margin: 12px 0 0; padding: 0; font-size: 13px; word-break: break-all; text-align: center;
  color: #1d4d1f; text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.link-out:not(:empty) {
  padding: 10px 12px; border-radius: 9px; border: 1px solid #7fae70;
  background: linear-gradient(180deg, #e9f7e3, #cfeac4); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
#msg { margin-top: 12px; font-weight: 600; }
.hidden { display: none; }

/* Landing (root) */
.app-badge { display: flex; justify-content: center; margin: 10px 0 12px; }
.app-badge img { width: 88px; height: 88px; border-radius: 22%; box-shadow: 0 2px 5px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5); }

@media (max-width: 480px) {
  .stage { padding: 0; }
  .phone { max-width: none; padding: 0; border-radius: 0; background: #000; box-shadow: none; }
  .phone::before, .phone::after { display: none; }
  .screen { height: 100dvh; border-radius: 0; box-shadow: none; }
  .statusbar { padding-top: env(safe-area-inset-top); height: calc(21px + env(safe-area-inset-top)); }
  .page { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
