/* Site Review: feedback panel on the left, the live site on the right. */
:root {
	--ink: #1C2022; --harbor: #366E92; --sky: #3EA5DD; --sea: #97CAEB; --light-sea: #ACD5EF;
	--mist: #E2F2FA; --sand: #F2E7D4; --shell: #FAF7F1; --driftwood: #E5E0D7; --muted: #4a5056;
	--display: "Newsreader", Georgia, serif; --body: "Heebo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body.sr { display: grid; grid-template-columns: minmax(300px, 25%) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; background: var(--shell); color: var(--ink); font: 15px/1.45 var(--body); }

/* Panel */
.sr-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--driftwood); background: var(--shell); }
.sr-head { background: var(--sand); padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.sr-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sr-brand a { font: 600 18px/1.2 var(--display); color: var(--ink); text-decoration: none; }
.sr-brand span, .sr-k, .sr-page__k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--harbor); }
.sr-page { margin: 0; display: flex; flex-direction: column; }
.sr-page strong { font: 600 20px/1.2 var(--display); }
.sr-page__path { font-size: 12px; color: var(--muted); word-break: break-all; }
.sr-scope { display: flex; gap: 2px; background: rgba(255,255,255,.6); border-radius: 999px; padding: 3px; }
.sr-scope button { flex: 1 1 auto; white-space: nowrap; border: 0; background: none; border-radius: 999px; padding: 5px 6px; font: 700 12.5px var(--body); color: var(--ink); cursor: pointer; }
.sr-scope button[aria-selected="true"] { background: var(--ink); color: #fff; }
.sr-count:empty { display: none; }
.sr-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--sea); color: var(--ink); font-size: 11px; line-height: 18px; text-align: center; }

/* Notes */
.sr-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.sr-empty { margin: 8px 0; color: var(--muted); }
.sr-group { margin: 6px 0 -4px; font: 600 16px/1.2 var(--display); }
.sr-group button { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--sea); text-underline-offset: 3px; }
.sr-group button:hover { color: var(--harbor); }
.sr-note { display: flex; flex-direction: column; gap: 6px; }
.sr-text, .sr-replytext { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; transition: background-color .15s ease, box-shadow .15s ease; }
.sr-text { background: var(--mist); padding: 10px 12px; }
.sr-text:hover { background: #CBE6F6; box-shadow: 0 2px 8px rgba(28,32,34,.12); }
.sr-replytext { position: relative; margin-left: 24px; background: #fff; border: 1px solid rgba(28,32,34,.18); padding: 8px 12px; }
.sr-replytext::before { content: "\21B3"; position: absolute; left: -20px; top: 6px; color: var(--muted); }
.sr-replytext:hover { background: #EEF7FC; box-shadow: 0 2px 8px rgba(28,32,34,.12); }
.is-new > .sr-text, .sr-replytext.is-new { background: var(--light-sea); }
.sr-by { font-size: 13px; color: #2b2f33; display: flex; flex-wrap: wrap; gap: 0 6px; }
.sr-by strong { font-weight: 700; }
.sr-by span + span::before { content: "· "; }
.sr-by.is-reply { margin-left: 24px; }
.sr-dev { color: var(--muted); font-size: 12px; cursor: help; flex-basis: 100%; }
.sr-by span.sr-dev::before { content: none; }
.sr-compose.is-site { background: var(--mist); }
.sr-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--harbor); color: #fff; border-radius: 999px; padding: 1px 8px; align-self: center; }
.sr-note.is-resolved > .sr-text { opacity: .6; text-decoration: line-through; text-decoration-color: rgba(28,32,34,.35); }
.sr-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sr-pill { font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 11px; background: #fff; cursor: pointer; }
.sr-pill:hover { background: var(--mist); }
.sr-votes { display: flex; gap: 4px; margin-right: auto; }
.sr-vote { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid rgba(28,32,34,.35); border-radius: 999px; background: #fff; color: var(--ink); padding: 2px 9px 2px 7px; font: 700 12px var(--body); cursor: pointer; }
.sr-vote svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-vote:hover { border-color: var(--ink); background: var(--mist); }
.sr-vote.is-up[aria-pressed="true"] { background: var(--sea); border-color: var(--harbor); }
.sr-vote.is-down[aria-pressed="true"] { background: var(--sand); border-color: #9b6b2c; }
.sr-vote[aria-pressed="true"] svg { fill: currentColor; fill-opacity: .25; }
.sr-pill.is-danger { border-color: #9b2c2c; color: #9b2c2c; }
.sr-replyform { display: flex; flex-direction: column; gap: 6px; margin-left: 24px; }
.sr-replyform textarea { min-height: 70px; }

/* Compose */
.sr-compose { flex: 0 0 auto; min-height: 25%; border-top: 1px solid var(--driftwood); background: #fff; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.sr-who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sr-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sr-field label { font-size: 13px; font-weight: 700; }
.sr-req, .sr-opt { font-weight: 400; font-size: 11px; color: var(--muted); }
.sr-as { margin: 0; font-size: 13px; }
input[type="text"], input[type="email"], textarea { width: 100%; font: inherit; font-size: 15px; border: 1.5px solid var(--ink); border-radius: 10px; padding: 7px 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 88px; flex: 1; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }
.sr-invalid { border-color: #9b2c2c !important; }
.sr-btn { align-self: flex-start; border: 0; border-radius: 999px; background: var(--sea); color: var(--ink); font: 700 15px var(--body); padding: 9px 20px; cursor: pointer; }
.sr-btn:hover { background: var(--light-sea); }
.sr-btn[disabled] { opacity: .6; cursor: progress; }
.sr-link { border: 0; background: none; padding: 0; color: var(--harbor); font: inherit; text-decoration: underline; cursor: pointer; }
.sr-msg { margin: 0; font-size: 13px; min-height: 0; }
.sr-msg:empty { display: none; }
.sr-msg.is-error { color: #9b2c2c; font-weight: 700; }
.sr-msg.is-ok { color: var(--harbor); font-weight: 700; }
.sr-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Site */
.sr-site { position: relative; min-width: 0; background: #fff; }
.sr-site iframe { display: block; width: 100%; height: 100%; border: 0; }
.sr-away { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--shell); text-align: center; padding: 24px; }
.sr-away[hidden] { display: none; }
.sr-switch { display: none; }
.sr-compose__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sr-about { display: none; }

/* Phones and narrow windows: one view at a time, with a switch at the bottom. */
/*
 * Phones and narrow windows: two views, switched at the bottom.
 * Website: the site, with the feedback box under it. Feedback: the tabs and everyone's notes.
 * The panel steps aside (display: contents) so its parts can sit in the page grid.
 */
@media (max-width: 799px) {
	body.sr { grid-template-columns: 1fr; }
	body[data-view="site"], body[data-view="give"] { grid-template-rows: minmax(0, 1fr) auto auto; }
	body[data-view="panel"] { grid-template-rows: auto minmax(0, 1fr) auto; }
	.sr-panel { display: contents; }
	.sr-head, .sr-list, .sr-site, .sr-compose { grid-column: 1; border-right: 0; }
	body[data-view="site"] .sr-head, body[data-view="site"] .sr-list, body[data-view="site"] .sr-compose,
	body[data-view="give"] .sr-head, body[data-view="give"] .sr-list,
	body[data-view="panel"] .sr-site, body[data-view="panel"] .sr-compose { display: none; }
	body[data-view="site"] .sr-site, body[data-view="give"] .sr-site { grid-row: 1; }
	body[data-view="give"] .sr-compose { grid-row: 2; }
	body[data-view="panel"] .sr-head { grid-row: 1; }
	body[data-view="panel"] .sr-list { grid-row: 2; }
	.sr-switch { display: flex; grid-row: 3; gap: 6px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--ink); }
	.sr-switch button { flex: 1; border: 1.5px solid rgba(255,255,255,.4); border-radius: 999px; padding: 8px; font: 700 14px var(--body); background: transparent; color: #fff; cursor: pointer; }
	.sr-switch [aria-pressed="true"] { background: var(--sea); border-color: var(--sea); color: var(--ink); }
	/* The feedback box under the site: compact, with Submit beside "Posting as". */
	.sr-compose { min-height: 0; padding: 8px 12px 10px; gap: 6px; border-top: 2px solid var(--sea); box-shadow: 0 -4px 12px rgba(28,32,34,.08);
		display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
		grid-template-areas: "top top" "who who" "note note" "msg msg" "as send"; }
	.sr-compose__top { grid-area: top; }
	.sr-who { grid-area: who; grid-template-columns: 1fr 1fr; }
	.sr-compose > textarea { grid-area: note; min-height: 56px; height: 64px; max-height: 30vh; }
	.sr-switch .sr-count { background: #fff; }
	.sr-msg { grid-area: msg; }
	.sr-as { grid-area: as; font-size: 12px; }
	.sr-btn#sr-send { grid-area: send; justify-self: end; padding: 8px 16px; font-size: 14px; }
	.sr-compose .sr-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
	.sr-about { display: flex; flex: 0 0 auto; gap: 2px; background: var(--shell); border-radius: 999px; padding: 2px; }
	.sr-about button { border: 0; background: none; border-radius: 999px; padding: 3px 8px; font: 700 12px var(--body); color: var(--ink); cursor: pointer; white-space: nowrap; }
	.sr-about button[aria-pressed="true"] { background: var(--ink); color: #fff; }
	.sr-compose.is-site .sr-about { background: #fff; }
}
