:root {
  --blue:#034bff;
  --cream:#fff5e5;
  --ink:#101314;
  --pink:#ff2999;
  --muted:#666963;
  --line:#ddd7cd;
  --paper:#fffcf6;
  font-family:'Avenir Next','Century Gothic',system-ui,sans-serif;
  color:var(--ink);
  background:var(--cream);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,textarea {
  font:inherit;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:wait;
  opacity:.55;
}

button,a,input,textarea {
  touch-action:manipulation;
}

button {
  border:0;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,iframe:focus-visible {
  outline:3px solid var(--blue);
  outline-offset:3px;
}

a {
  color:inherit;
}

h1,h2,p {
  margin:0;
}

button[hidden],[hidden] {
  display:none!important;
}

.skip-link {
  position:fixed;
  top:10px;
  left:10px;
  background:var(--cream);
  padding:12px;
  z-index:20;
  transform:translateY(-200%);
}

.skip-link:focus {
  transform:none;
}

.review-app {
  height:100dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.topbar {
  height:88px;
  flex-shrink:0;
  background:var(--cream);
  display:flex;
  align-items:center;
  gap:24px;
  padding:16px 28px;
  border-bottom:1px solid var(--line);
}

.brand {
  display:block;
  line-height:0;
}

.brand img {
  object-fit:contain;
}

.project {
  display:flex;
  flex-direction:column;
  gap:5px;
  border-left:1px solid #d7d0c5;
  padding-left:24px;
}

.project strong {
  font-size:17px;
  letter-spacing:-.02em;
}

.project>span {
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:var(--muted);
}

.live-dot {
  width:6px;
  height:6px;
  background:#26754c;
  border-radius:50%;
}

.branch {
  font-size:10px;
  border:1px solid var(--line);
  padding:2px 5px;
  border-radius:3px;
}

.top-actions {
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}

.quiet {
  padding:10px 12px;
  background:transparent;
  color:var(--ink);
  font-size:12px;
  border-radius:6px;
  min-height:40px;
}

.quiet:hover {
  background:#eae3d8;
}

.count {
  background:var(--ink);
  color:var(--cream);
  padding:2px 6px;
  border-radius:20px;
  font-size:10px;
  margin-left:5px;
}

.workspace {
  display:flex;
  min-height:0;
  flex:1;
}

.canvas {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  background:#e8e7e2;
}

.toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 22px;
  background:#f8f6f1;
  border-bottom:1px solid var(--line);
  flex-shrink:0;
}

.modes {
  display:flex;
  gap:5px;
}

.modes button {
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  padding:10px 12px;
  background:transparent;
  border-radius:6px;
  font-size:12px;
  min-height:40px;
}

.modes button span {
  font-size:18px;
  line-height:1;
}

.modes button[aria-pressed=true] {
  background:var(--blue);
  color:white;
  box-shadow:0 2px 5px #034bff20;
}

.modes button:hover:not([aria-pressed=true]) {
  background:#e9e6df;
}

.viewports {
  display:flex;
  padding:3px;
  border:1px solid var(--line);
  border-radius:6px;
}

.viewports button {
  background:transparent;
  font-size:22px;
  width:34px;
  height:34px;
  border-radius:3px;
}

.viewports button[aria-pressed=true] {
  background:white;
  box-shadow:0 1px 4px #0001;
}

.preview-meta {
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 24px;
  font-size:11px;
  color:#666963;
  min-height:39px;
}

.preview-meta>#page-label {
  font-family:ui-monospace,monospace;
  color:var(--ink);
  max-width:160px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.preview-meta>#mode-help {
  border-left:1px solid #c7c7c0;
  padding-left:14px;
}

.frame-stage {
  position:relative;
  margin:0 22px;
  flex:1;
  min-height:0;
  display:flex;
  justify-content:center;
  overflow:hidden;
}

#preview {
  background:white;
  width:100%;
  height:100%;
  border:1px solid #d2d3cc;
  border-radius:8px;
  box-shadow:0 4px 20px #1013140c;
}

.frame-stage.mobile #preview {
  width:390px;
  max-width:100%;
}

.canvas-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:7px 24px;
  min-height:42px;
  font-size:10px;
  color:var(--muted);
}

.text-button {
  background:transparent;
  color:var(--blue);
  padding:10px 0;
  font-size:12px;
  min-height:40px;
}

.loading {
  position:absolute;
  inset:0;
  background:#faf8f1;
  display:grid;
  place-items:center;
  font-size:14px;
  color:var(--muted);
}

.feedback-panel {
  width:352px;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  background:var(--cream);
  border-left:1px solid var(--line);
  overflow-y:auto;
}

.panel-heading {
  display:flex;
  align-items:start;
  justify-content:space-between;
  padding:32px 26px 14px;
}

.panel-heading h1 {
  font-size:28px;
  font-weight:750;
  line-height:1.13;
  letter-spacing:-.04em;
}

.panel-heading h1 span,.login-card h1 span {
  color:var(--blue);
}

#panel-close {
  margin-left:auto;
  font-size:22px;
}

.panel-top {
  display:flex;
  align-items:center;
  gap:6px;
  padding:14px 14px 0 20px;
}

.panel-tabs {
  display:flex;
  gap:4px;
  padding:3px;
  border:1px solid var(--line);
  border-radius:7px;
}

.panel-tabs button {
  padding:8px 11px;
  min-height:34px;
  border-radius:5px;
  background:transparent;
  color:var(--muted);
  font-size:11px;
  font-weight:600;
}

.panel-tabs button[aria-pressed=true] {
  background:var(--ink);
  color:var(--cream);
}

.panel-tabs #tab-brief[aria-pressed=false]::after {
  content:'';
  display:inline-block;
  width:6px;
  height:6px;
  margin-left:6px;
  border-radius:50%;
  background:var(--pink);
  vertical-align:middle;
}

.feedback-view {
  display:flex;
  flex-direction:column;
  flex:1;
}

.panel-top+.brief .panel-heading,.panel-top~.feedback-view .panel-heading {
  padding-top:22px;
}

.brief-heading {
  flex-direction:column;
  gap:8px;
}

.brief-date {
  font-size:10px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--pink);
  font-weight:700;
}

.brief-intro {
  font-size:13px;
  line-height:1.65;
  color:#3a3d3a;
}

.brief-section {
  margin:8px 16px 0;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.brief-section h2 {
  font-size:12px;
  letter-spacing:.05em;
  text-transform:uppercase;
  margin:0 10px 4px;
}

.brief-list {
  list-style:none;
  margin:0;
  padding:0;
  counter-reset:brief;
}

.brief-item {
  background:var(--paper);
  border:1px solid var(--line);
  border-left:3px solid var(--pink);
  border-radius:8px;
  padding:14px 16px 6px;
  margin-top:10px;
  counter-increment:brief;
}

ol.brief-list .brief-item {
  border-left-color:var(--blue);
}

ol.brief-list .brief-item h3::before {
  content:counter(brief) '. ';
  color:var(--blue);
}

.brief-item h3 {
  font-size:14px;
  letter-spacing:-.01em;
  margin:0 0 6px;
}

.brief-body {
  font-size:12px;
  line-height:1.7;
  margin-bottom:6px;
  overflow-wrap:anywhere;
}

.brief-close {
  margin:18px 26px 28px;
  font-size:11px;
  line-height:1.6;
  color:var(--muted);
}

.filters {
  display:flex;
  gap:7px;
  margin:0 26px;
  padding-bottom:15px;
  border-bottom:1px solid var(--line);
}

.filters button {
  padding:8px 10px;
  font-size:11px;
  border-radius:5px;
  background:transparent;
  color:var(--muted);
  min-height:36px;
}

.filters button[aria-pressed=true] {
  background:var(--ink);
  color:var(--cream);
}

.filters span {
  opacity:.65;
  margin-left:6px;
}

.page-filter {
  display:flex;
  align-items:center;
  gap:7px;
  margin:15px 26px 10px;
  font-size:11px;
  color:var(--muted);
}

.page-filter input {
  accent-color:var(--blue);
  width:15px;
  height:15px;
}

.feedback-list {
  flex:1;
  padding:0 16px 18px;
}

.empty {
  margin:20px 10px 24px;
  border:1px dashed #c6c3b9;
  padding:28px 18px;
  text-align:center;
  border-radius:8px;
}

.empty-symbol {
  display:block;
  font-size:32px;
  color:var(--blue);
  margin-bottom:15px;
}

.empty h2 {
  font-size:16px;
  letter-spacing:-.025em;
  margin-bottom:9px;
}

.empty p {
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
}

.card {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:8px;
  padding:16px;
  margin-top:10px;
}

.card.selected {
  border-color:var(--blue);
  box-shadow:0 0 0 1px var(--blue);
}

.card-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:10px;
  color:var(--muted);
  margin-bottom:12px;
}

.card-title {
  display:flex;
  gap:8px;
  align-items:center;
}

.pin-number {
  display:inline-grid;
  place-items:center;
  background:var(--blue);
  color:white;
  border-radius:50%;
  min-width:23px;
  height:23px;
  padding:0 5px;
  font-size:10px;
  font-weight:700;
}

.card-body {
  font-size:12px;
  line-height:1.7;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.card blockquote,.brief-item blockquote {
  font-size:12px;
  line-height:1.65;
  margin:10px 0;
  padding:9px 11px;
  border-left:2px solid #cabfb0;
  background:#f2ede4;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.card .replacement,.brief-item .replacement {
  border-left-color:var(--blue);
  background:#ebf0ff;
}

.copy-label {
  display:block;
  color:var(--muted);
  font-size:9px;
  letter-spacing:.05em;
  margin-top:10px;
}

.card-meta {
  display:flex;
  justify-content:space-between;
  font-size:10px;
  color:var(--muted);
  margin-top:12px;
  gap:8px;
}

.card-path {
  display:block;
  font:10px ui-monospace,monospace;
  color:var(--muted);
  margin-top:9px;
  overflow-wrap:anywhere;
}

.card-actions {
  display:flex;
  justify-content:space-between;
  margin-top:12px;
  border-top:1px solid var(--line);
  padding-top:4px;
}

.card-actions button {
  font-size:10px;
}

.stale {
  font-size:10px;
  color:#80590b;
  background:#fff0cc;
  border-radius:3px;
  padding:5px 7px;
  margin-top:10px;
  line-height:1.5;
}

dialog {
  border:1px solid var(--line);
  border-radius:14px;
  padding:28px;
  max-width:480px;
  width:calc(100% - 32px);
  max-height:calc(100dvh - 40px);
  overflow:auto;
  background:var(--cream);
  color:var(--ink);
  box-shadow:0 20px 80px #10131440;
}

dialog::backdrop {
  background:#10131460;
  backdrop-filter:blur(3px);
}

.dialog-heading {
  display:flex;
  justify-content:space-between;
  gap:15px;
}

.dialog-heading h2 {
  font-size:25px;
  letter-spacing:-.035em;
}

.dialog-heading .quiet {
  font-size:24px;
  margin:-12px -12px 0 0;
}

.draft-context {
  font-size:11px;
  color:var(--muted);
  margin:12px 0 22px;
  overflow-wrap:anywhere;
}

form label {
  display:block;
  font-size:12px;
  font-weight:600;
  margin:15px 0 8px;
}

input:not([type=checkbox]),textarea {
  width:100%;
  padding:12px 13px;
  border:1px solid #c6c3b9;
  border-radius:6px;
  background:var(--paper);
  color:var(--ink);
  font-size:14px;
}

textarea {
  resize:vertical;
  line-height:1.65;
  min-height:92px;
}

input:not([type=checkbox]) {
  height:46px;
}

#original-copy {
  font-size:12px;
  font-weight:400;
  line-height:1.6;
  margin:8px 0 18px;
  padding:12px 14px;
  background:#eae5da;
  border-radius:5px;
  max-height:140px;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.dialog-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-top:22px;
}

.primary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  background:var(--blue);
  color:white;
  padding:13px 17px;
  border-radius:6px;
  font-size:13px;
  font-weight:600;
  min-height:46px;
}

.primary:hover {
  background:#003bd0;
}

.primary span {
  font-size:19px;
  font-weight:400;
}

.error {
  color:#a02222;
  font-size:12px;
  line-height:1.6;
  margin-top:14px;
}

.notice {
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  z-index:10;
  max-width:calc(100% - 32px);
  padding:12px 20px;
  border-radius:7px;
  background:var(--ink);
  color:var(--cream);
  box-shadow:0 4px 24px #0002;
  font-size:12px;
  line-height:1.6;
}

.notice a {
  color:white;
}

.draft-button {
  position:fixed;
  bottom:24px;
  left:24px;
  background:var(--blue);
  color:white;
  border-radius:7px;
  box-shadow:0 4px 24px #034bff40;
  padding:14px 20px;
  z-index:5;
  font-size:12px;
}

.login-page {
  min-height:100dvh;
  background:var(--blue);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:32px 20px;
}

.login-card {
  width:100%;
  max-width:440px;
  padding:38px 42px;
  background:var(--cream);
  border-radius:12px;
  box-shadow:10px 10px 0 #101314;
}

.login-card>img {
  object-fit:contain;
  margin-bottom:35px;
}

.login-card h1 {
  font-size:48px;
  line-height:1.05;
  letter-spacing:-.05em;
  margin-bottom:20px;
}

.login-card form {
  margin-top:24px;
}

.login-card .primary {
  width:100%;
  margin-top:18px;
}

@media(min-width:1051px) {
  .feedback-panel[hidden] {
    display:none!important;
  }
}

@media(max-width:1050px) {
  .topbar {
    padding:12px 18px;
    gap:16px;
    height:76px;
  }
  .project {
    padding-left:16px;
  }
  .feedback-panel {
    width:320px;
  }
  .toolbar {
    padding:10px 14px;
  }
  .modes button {
    padding:9px;
  }
  .frame-stage {
    margin:0 14px;
  }
  .preview-meta {
    padding:10px 16px;
  }
  .panel-heading {
    padding:26px 22px 14px;
  }
  .panel-heading h1 {
    font-size:25px;
  }
}

@media(max-width:800px) {
  .feedback-panel {
    position:fixed;
    right:0;
    top:76px;
    bottom:0;
    width:min(352px,100%);
    z-index:6;
    box-shadow:-15px 0 50px #10131430;
  }
  .project strong {
    font-size:14px;
  }
  .top-actions {
    gap:0;
  }
  .top-actions .quiet {
    font-size:11px;
    padding:10px 7px;
  }
  #refresh span {
    display:none;
  }
  .toolbar {
    gap:5px;
  }
  .modes {
    gap:3px;
  }
  .modes button {
    font-size:11px;
    gap:5px;
    padding:9px;
  }
  .preview-meta>#mode-help {
    font-size:10px;
  }
  .canvas-footer {
    padding-inline:16px;
  }
  .canvas-footer>span {
    display:none;
  }
}

@media(max-width:480px) {
  .topbar {
    height:70px;
    padding:10px 12px;
    gap:12px;
  }
  .brand img {
    width:48px;
    height:40px;
  }
  .project {
    border:0;
    padding:0;
  }
  .project strong {
    font-size:12px;
  }
  .project>span {
    font-size:10px;
  }
  .branch {
    display:none;
  }
  .top-actions .quiet {
    font-size:10px;
    min-height:38px;
  }
  #sign-out {
    padding-inline:5px;
  }
  .feedback-panel {
    top:70px;
  }
  .toolbar {
    padding:8px 9px;
  }
  .modes button {
    flex-direction:column;
    font-size:10px;
    padding:7px 8px;
    gap:4px;
  }
  .modes button span {
    font-size:17px;
  }
  .viewports button {
    width:27px;
    height:36px;
  }
  .preview-meta {
    padding:8px 12px;
    min-height:44px;
    gap:10px;
  }
  .preview-meta>#page-label {
    max-width:75px;
  }
  .preview-meta>#mode-help {
    padding-left:10px;
    line-height:1.5;
  }
  .frame-stage {
    margin:0 8px;
  }
  #preview {
    border-radius:5px;
  }
  .canvas-footer {
    padding-block:2px;
    min-height:38px;
  }
  .canvas-footer button {
    font-size:10px;
  }
  .login-card {
    padding:30px 28px;
  }
  .login-card h1 {
    font-size:42px;
  }
  dialog {
    padding:22px;
  }
  .draft-button {
    bottom:16px;
    left:16px;
  }
}

@media(prefers-reduced-motion:no-preference) {
  button {
    transition:background .15s,color .15s;
  }
  dialog[open] {
    animation:appear .15s ease-out;
  }
  @keyframes appear {
    from {
      opacity:0;
      transform:translateY(8px);
    }
    to {
      opacity:1;
      transform:translateY(0);
    }
  }
}

@media(max-width:480px) {
  .project {
    min-width:0;
    flex:1;
  }
  .project strong {
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .project>span {
    white-space:nowrap;
    overflow:hidden;
  }
  .top-actions {
    flex-shrink:0;
  }
}

@media(max-width:360px) {
  .viewports {
    display:none;
  }
  .modes {
    width:100%;
    justify-content:space-between;
  }
  .modes button {
    padding-inline:7px;
  }
}

#mode-help:empty { display:none; }
#pins-toggle { margin-left:auto; min-height:24px; padding:0; font-size:11px; white-space:nowrap; }
.canvas-footer { justify-content:flex-end; }
.panel-heading { padding-bottom:24px; }
