/* Reina admin — Made by Binary */
:root {
  --ink: #0f3f3e;
  --ink-2: #195654;
  --ink-soft: #e4eceb;
  --paper: #f2f5f4;
  --card: #ffffff;
  --line: #dde4e2;
  --line-strong: #c4cfcc;
  --text: #172322;
  --muted: #5b6a67;
  --accent: #e28242;
  --accent-ink: #a8541d;
  --accent-soft: #fcefe5;
  --danger: #b03a2e;
  --danger-soft: #fbeae7;
  --ok: #1f6f58;
  --ok-soft: #e1f1ea;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 40, 38, 0.06), 0 8px 24px rgba(15, 40, 38, 0.06);
  --rail: 88px;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

code {
  border-radius: 5px;
  background: var(--ink-soft);
  padding: 0.05em 0.35em;
  font-size: 0.88em;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

:focus-visible {
  outline: 3px solid rgba(226, 130, 66, 0.55);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
}

.skip:focus {
  top: 12px;
}

/* ---- Wordmark --------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
  color: var(--ink);
  font: 600 28px/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark-sm {
  font-size: 22px;
}

.wordmark-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-2);
}

.btn-ghost {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: #f8faf9;
}

.btn-text {
  background: transparent;
  color: var(--muted);
}

.btn-text:hover {
  background: rgba(15, 63, 62, 0.06);
  color: var(--text);
}

.btn-danger,
.btn-danger:hover {
  color: var(--danger);
}

.is-confirming .btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(15, 63, 62, 0.07);
  color: var(--ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

/* ---- Fields ----------------------------------------------------------- */
.f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.f-label {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.f-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.f-hint.is-error {
  color: var(--danger);
}

.f input,
.f select,
.f textarea,
.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.45;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.f textarea {
  min-height: 0;
  resize: vertical;
}

.f select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6a67' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
}

.f input:hover,
.f select:hover,
.f textarea:hover {
  border-color: var(--line-strong);
}

.f input:focus,
.f select:focus,
.f textarea:focus,
.auth-form input:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 63, 62, 0.14);
}

[data-link-input] {
  margin-top: 6px;
}

.f-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.f-row:has(> .f-narrow:last-child) {
  grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.f-row:has(> .f-narrow:first-child) {
  grid-template-columns: 8.5rem minmax(0, 1fr);
}

.f-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.f-group-first {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.f-group-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

/* ---- Photo ------------------------------------------------------------ */
.photo {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.photo-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: var(--ink-soft);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty {
  color: var(--muted);
  font-size: 13px;
}

.photo-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.photo-pick {
  position: relative;
  overflow: hidden;
}

.photo-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-pick:focus-within {
  outline: 3px solid rgba(226, 130, 66, 0.55);
  outline-offset: 2px;
}

/* ---- Rail (desktop) --------------------------------------------------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--rail);
  background: var(--ink);
  color: #fff;
  padding: 18px 0 14px;
}

.rail-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font: 600 24px/1 var(--serif);
  text-decoration: none;
}

.rail-nav,
.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-foot {
  margin-top: auto;
}

.rail-foot form {
  margin: 0;
}

.rail-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 74px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 10px 0 9px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.rail-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.rail-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.rail-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.rail-link-quiet {
  color: rgba(255, 255, 255, 0.55);
}

.rail-icon {
  position: relative;
  display: grid;
  place-items: center;
}

.rail-icon .icon {
  width: 21px;
  height: 21px;
}

.rail-badge {
  position: absolute;
  top: -7px;
  right: -11px;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  padding: 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.mobile-top,
.tabbar {
  display: none;
}

/* ---- Stage ------------------------------------------------------------ */
.stage {
  min-height: 100vh;
  margin-left: var(--rail);
}

.site-form {
  display: contents;
}

.view {
  width: min(100% - 64px, 860px);
  margin: 0 auto;
  padding: 44px 0 64px;
}

.view-head {
  margin-bottom: 24px;
}

.view-head h1 {
  color: var(--ink);
  font: 600 34px/1.15 var(--serif);
  letter-spacing: -0.01em;
}

.view-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15.5px;
}

.view-head-tight {
  margin-bottom: 8px;
  padding: 28px 28px 0;
}

.view-head-tight h1 {
  font-size: 28px;
}

/* ---- Notices & toast -------------------------------------------------- */
.notice {
  border-radius: var(--radius-sm);
  background: var(--ink-soft);
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
}

.notice-error {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
}

.notice-ok {
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}

.notice-floating {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 120;
  width: min(100% - 32px, 520px);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(100% - 32px, 420px);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 40, 38, 0.28);
  animation: toast-in 260ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transition: opacity 400ms ease, transform 400ms ease;
}

.toast .icon {
  color: var(--accent);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---- Requests --------------------------------------------------------- */
.segmented {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: #e3e9e7;
  padding: 4px;
}

.segmented a {
  border-radius: 7px;
  color: var(--muted);
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.segmented a span {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 500;
}

.segmented a[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 40, 38, 0.12);
}

.requests {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 0;
  list-style: none;
}

.request {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 24px;
}

.request + .request {
  border-top: 1px solid var(--line);
}

.request-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink);
  font: 600 18px/1 var(--serif);
}

.request.is-new .request-avatar {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent);
}

.request-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.request-top h2 {
  font-size: 16px;
  font-weight: 650;
}

.request-top time {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tag {
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--ink);
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.request-email {
  display: inline-block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.request-email:hover {
  color: var(--ink);
  text-decoration: underline;
}

.request-text {
  max-width: 66ch;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.request-actions form {
  margin: 0;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--text);
  font-size: 16px;
}

.empty p {
  max-width: 46ch;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink);
}

.empty-icon .icon {
  width: 24px;
  height: 24px;
}

/* ---- Website: editor + preview ---------------------------------------- */
.view-website {
  display: grid;
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--card);
  scrollbar-width: thin;
}

.sections {
  flex: 1 0 auto;
  padding: 8px 0 24px;
}

.sec {
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 0;
}

.sec-head button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 16px 28px;
  text-align: left;
  cursor: pointer;
}

.sec-head button:hover {
  background: #f7f9f8;
}

.sec-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.sec-summary {
  grid-column: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sec-chevron {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--muted);
  transition: transform 180ms ease;
}

.sec.is-open .sec-head button {
  background: transparent;
}

.sec.is-open .sec-name {
  color: var(--ink);
}

.sec.is-open .sec-summary {
  display: none;
}

.sec.is-open .sec-chevron {
  transform: rotate(180deg);
}

.sec-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px 28px 28px;
}

/* Repeating items */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.item[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 6px 8px 6px 14px;
  list-style: none;
  cursor: pointer;
}

.item-head::-webkit-details-marker {
  display: none;
}

.item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-tools {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.item:hover .item-tools,
.item:focus-within .item-tools,
.item[open] .item-tools {
  opacity: 1;
}

.item-tools .icon-btn {
  width: 30px;
  height: 30px;
}

.item-tools .icon-btn .icon {
  width: 15px;
  height: 15px;
}

.icon-btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.item.is-confirming .icon-btn-danger {
  background: var(--danger);
  color: #fff;
}

.item-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.item[open] .item-chevron {
  transform: rotate(180deg);
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 14px 18px;
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-add:hover {
  border-color: var(--ink);
  background: #f7f9f8;
}

/* Save bar */
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 28px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.save-state {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.save-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ok);
}

.is-dirty .save-state {
  color: var(--accent-ink);
  font-weight: 600;
}

.is-dirty .save-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.app:not(.is-dirty) [data-save-button] {
  border-color: var(--line);
  background: var(--card);
  color: var(--muted);
}

.preview-open {
  display: none;
}

/* Preview pane */
.preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #e6ecea;
  padding: 16px 24px 24px;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-close {
  display: none;
}

.preview-url {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  padding: 0 16px;
  font-size: 13.5px;
}

.preview-url span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-url .icon {
  width: 14px;
  height: 14px;
}

.device {
  display: inline-flex;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  padding: 3px;
}

.device button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.device button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 40, 38, 0.14);
}

.device .icon {
  width: 17px;
  height: 17px;
}

.preview-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fcfaf6;
  box-shadow: 0 1px 2px rgba(15, 40, 38, 0.08), 0 20px 50px rgba(15, 40, 38, 0.14);
}

.preview-viewport iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background: #fcfaf6;
  transform-origin: 0 0;
}

.preview-viewport:has(iframe.is-phone) {
  background: transparent;
  box-shadow: none;
}

.preview-viewport iframe.is-phone {
  top: 16px;
  left: 50%;
  border-radius: 28px;
  box-shadow: 0 0 0 10px #1b2523, 0 24px 60px rgba(15, 40, 38, 0.3);
  translate: -50% 0;
  transform-origin: 50% 0;
}

/* ---- Settings --------------------------------------------------------- */
.view-settings {
  width: min(100% - 64px, 760px);
}

.view-settings-tail {
  padding-top: 0;
}

.view-settings:not(.view-settings-tail) {
  padding-bottom: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 24px;
}

.panel h2 {
  color: var(--ink);
  font: 600 20px/1.3 var(--serif);
}

.panel-note {
  color: var(--muted);
}

.panel-note strong {
  color: var(--text);
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.serp {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfc;
  padding: 16px 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.serp-url {
  color: #4d5156;
  font-size: 13px;
}

.serp-title {
  color: #1a0dab;
  font-size: 19px;
  line-height: 1.3;
}

.serp-desc {
  color: #4d5156;
  font-size: 14px;
  line-height: 1.5;
}

.credit,
.auth-credit {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.credit a,
.auth-credit a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.credit a:hover,
.auth-credit a:hover {
  text-decoration: underline;
}

/* ---- Sign in ---------------------------------------------------------- */
.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100vh;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(15, 63, 62, 0.12), transparent 70%),
    var(--paper);
}

.auth-card {
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-top: 30px;
  color: var(--ink);
  font: 600 26px/1.2 var(--serif);
}

.auth-lede {
  margin-top: 6px;
  color: var(--muted);
}

.auth-card .notice {
  margin-top: 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.auth-form .btn {
  min-height: 46px;
  margin-top: 4px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-back .icon {
  width: 15px;
  height: 15px;
}

/* ---- Small screens ---------------------------------------------------- */
@media (max-width: 979px) {
  .rail {
    display: none;
  }

  .stage {
    margin-left: 0;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    padding: 0 8px 0 18px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .mobile-top-actions {
    display: flex;
    gap: 2px;
  }

  .mobile-top-actions form {
    margin: 0;
  }

  .mobile-top .icon-btn {
    width: 44px;
    height: 44px;
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: var(--card);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 64px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }

  .tabbar a[aria-current="page"] {
    color: var(--ink);
  }

  .tabbar a[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }

  .tabbar .rail-badge {
    border-color: var(--card);
  }

  .view {
    width: calc(100% - 32px);
    padding: 24px 0 32px;
  }

  .view-head h1 {
    font-size: 28px;
  }

  .request {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px;
  }

  .request-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .request-top time {
    width: 100%;
    margin-left: 0;
    order: 3;
  }

  .request-actions .btn-primary {
    flex: 1 1 100%;
  }

  .view-website {
    display: block;
    height: auto;
  }

  .editor {
    overflow: visible;
    border-right: 0;
  }

  .view-head-tight {
    padding: 22px 16px 4px;
  }

  .sec-head button {
    padding: 16px;
  }

  .sec-body {
    padding: 2px 16px 24px;
  }

  .savebar {
    position: fixed;
    inset: auto 0 calc(64px + env(safe-area-inset-bottom));
    padding: 10px 16px;
  }

  .save-state {
    font-size: 13px;
  }

  .preview-open {
    display: inline-flex;
  }

  .view-website .sections {
    padding-bottom: 80px;
  }

  .preview {
    display: none;
  }

  .preview-sheet .preview {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    padding: 12px 12px 16px;
  }

  .preview-sheet .preview-close {
    display: inline-grid;
    background: var(--card);
  }

  .view-settings {
    width: calc(100% - 32px);
  }

  .panel {
    padding: 20px 16px;
  }

  .toast {
    right: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 16px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .f-row,
  .f-row:has(> .f-narrow:last-child),
  .f-row:has(> .f-narrow:first-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .auth-card {
    padding: 28px 22px;
  }
}

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

/* ---- Fixes after first review ----------------------------------------- */
.settings-save {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 14px 16px 14px 24px;
}

@media (max-width: 979px) {
  .view-website {
    width: 100%;
    padding: 0;
  }

  .settings-save {
    padding: 12px 12px 12px 16px;
  }
}

/* ---- Liquid-glass floating bars (phones) & no stacked buttons --------- */
.lbl-short {
  display: none;
}

@media (max-width: 979px) {
  .stage {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-top {
    background: rgba(255, 255, 255, 0.62);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
  }

  .tabbar {
    inset: auto 14px calc(12px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    background: rgba(250, 252, 251, 0.58);
    padding: 5px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      inset 0 -1px 0 rgba(15, 63, 62, 0.05),
      0 12px 32px rgba(15, 40, 38, 0.18),
      0 2px 6px rgba(15, 40, 38, 0.08);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
  }

  .tabbar a {
    height: auto;
    border-radius: 26px;
    font-size: 11px;
    transition: background-color 200ms ease, color 200ms ease;
  }

  .tabbar a[aria-current="page"] {
    background: rgba(15, 63, 62, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .tabbar a[aria-current="page"]::before {
    display: none;
  }

  .tabbar .rail-badge {
    border-color: rgba(250, 252, 251, 0.9);
  }

  /* Save bar floats as a second glass pill just above the tab bar */
  .savebar {
    inset: auto 14px calc(86px + env(safe-area-inset-bottom));
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    background: rgba(250, 252, 251, 0.62);
    padding: 6px 6px 6px 16px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 10px 28px rgba(15, 40, 38, 0.16);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
  }

  .savebar .btn {
    min-height: 42px;
    border-radius: 22px;
  }

  .savebar .save-state span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view-website .sections {
    padding-bottom: 72px;
  }

  .toast {
    bottom: calc(150px + env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  /* Request buttons stay on one line */
  .request-actions {
    flex-wrap: nowrap;
    align-items: center;
  }

  .request-actions .btn-primary {
    flex: 1 1 auto;
  }

  .request-actions .lbl-long {
    display: none;
  }

  .request-actions .lbl-short {
    display: inline;
  }

  .request-actions .lbl-delete {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .request-actions .is-confirming .lbl-delete {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
  }
}

@media (max-width: 380px) {
  .savebar .save-state span:last-child {
    display: none;
  }
}

@media (max-width: 979px) {
  .savebar .lbl-long,
  .request-actions .lbl-long {
    display: none;
  }

  .savebar .lbl-short {
    display: inline;
  }

  .request-actions .btn-primary {
    min-width: 0;
  }

  .request-actions .btn {
    padding: 0 12px;
  }

  .request-actions .is-confirming .btn-danger {
    padding: 0 12px;
  }
}

@media (max-width: 979px) {
  .request-actions:has(.is-confirming) .btn-primary .lbl-short {
    display: none;
  }

  .request-actions:has(.is-confirming) .btn-primary {
    flex: 0 0 auto;
  }
}

/* ---- Phone: Save lives top-right in the header, iOS style ------------- */
.mobile-top-save,
.signout-row {
  display: none;
}

@media (max-width: 979px) {
  .app[data-view="website"] .mobile-top-save {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .app[data-view="website"] .mobile-top-actions {
    display: none;
  }

  .mobile-top-save .icon-btn {
    width: 44px;
    height: 44px;
  }

  .btn-pill {
    position: relative;
    min-height: 36px;
    border-radius: 18px;
    padding: 0 18px;
    font-size: 15px;
  }

  .save-pip {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .is-dirty .save-pip {
    opacity: 1;
    transform: scale(1);
  }

  .savebar {
    display: none;
  }

  .view-website .sections {
    padding-bottom: 8px;
  }

  .signout-row {
    display: block;
    margin-bottom: 16px;
  }

  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 979px) {
  .tabbar,
  .mobile-top {
    background: rgba(250, 252, 251, 0.8);
  }

  .app[data-view="settings"] .mobile-top-save {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .app[data-view="settings"] .mobile-top-save [data-preview-open],
  .app[data-view="settings"] .mobile-top-actions,
  .settings-save {
    display: none;
  }
}

/* =====================================================================
   v3 layout: floating rail, framed panels, no visible scrollbars
   ===================================================================== */
html,
.editor,
.preview-viewport,
.sections {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
.editor::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (min-width: 980px) {
  :root {
    --gap: 14px;
    --rail: 84px;
  }

  body.app {
    background: #edf1ef;
  }

  /* Floating rail */
  .rail {
    inset: var(--gap) auto var(--gap) var(--gap);
    width: var(--rail);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    padding: 14px 0 12px;
    box-shadow: 0 1px 2px rgba(15, 40, 38, 0.06), 0 12px 32px rgba(15, 40, 38, 0.08);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
  }

  .rail-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 13px;
    background: transparent;
    box-shadow: 0 6px 14px rgba(17, 76, 76, 0.25);
  }

  .rail-mark img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .rail-nav,
  .rail-foot {
    gap: 6px;
  }

  .rail-foot {
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .rail-link {
    width: 68px;
    gap: 6px;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    padding: 6px 0 8px;
    font-size: 11.5px;
    font-weight: 600;
  }

  .rail-link .rail-icon {
    width: 44px;
    height: 36px;
    border-radius: 12px;
    transition: background-color 160ms ease, color 160ms ease;
  }

  .rail-link .rail-icon .icon {
    width: 20px;
    height: 20px;
  }

  .rail-link:hover {
    background: transparent;
    color: var(--text);
  }

  .rail-link:hover .rail-icon {
    background: rgba(15, 63, 62, 0.07);
  }

  .rail-link[aria-current="page"] {
    background: transparent;
    color: var(--ink);
  }

  .rail-link[aria-current="page"]::before {
    display: none;
  }

  .rail-link[aria-current="page"] .rail-icon {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 6px 14px rgba(15, 63, 62, 0.25);
  }

  .rail-link-quiet {
    color: var(--muted);
  }

  .rail-badge {
    top: -4px;
    right: -4px;
    border-color: #fff;
  }

  /* Pages sit beside the rail with even margins */
  .stage {
    margin-left: calc(var(--rail) + var(--gap) * 2);
    padding-right: var(--gap);
  }

  .view {
    padding-top: 36px;
  }

  /* Website editor: two framed panels with the same gaps all round */
  .view-website {
    gap: var(--gap);
    width: 100%;
    height: 100vh;
    padding: var(--gap) 0;
  }

  .editor {
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(15, 40, 38, 0.04);
  }

  .savebar {
    border-radius: 0 0 22px 22px;
  }

  .preview {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #e3e9e7;
    padding: 14px 18px 18px;
  }

  .preview-viewport {
    border-radius: 14px;
  }

  .requests,
  .panel,
  .settings-save,
  .empty {
    border-radius: 18px;
  }
}

/* Hide the page scrollbar inside the live preview frame too */

/* Brand tile also looks right if the page still prints the letter instead of the image */
@media (min-width: 980px) {
  .rail-mark {
    background: var(--ink);
    color: #fff;
    font: 600 22px/1 var(--serif);
  }
}

/* ---- Liquid-glass sidebar (desktop) ----------------------------------- */
@media (min-width: 980px) {
  body.app {
    background:
      radial-gradient(560px 460px at 0% 6%, rgba(17, 76, 76, 0.30), transparent 70%),
      radial-gradient(460px 400px at 2% 94%, rgba(226, 130, 66, 0.28), transparent 70%),
      radial-gradient(900px 600px at 70% -10%, rgba(17, 76, 76, 0.06), transparent 70%),
      #edf1ef;
    background-attachment: fixed;
  }

  .rail {
    border: 1px solid rgba(255, 255, 255, 0.65);
    background:
      linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.18) 55%, rgba(255, 255, 255, 0.34) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      inset 1px 0 0 rgba(255, 255, 255, 0.55),
      inset 0 -1px 0 rgba(17, 76, 76, 0.06),
      0 18px 40px rgba(15, 40, 38, 0.12),
      0 2px 6px rgba(15, 40, 38, 0.06);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    backdrop-filter: blur(28px) saturate(190%);
  }

  /* soft light sheen across the top of the glass */
  .rail::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 45%;
    border-radius: 24px 24px 60% 60% / 24px 24px 18% 18%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    pointer-events: none;
  }

  .rail > * {
    position: relative;
  }

  .rail-foot {
    border-top-color: rgba(17, 76, 76, 0.1);
  }

  .rail-link:hover .rail-icon {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .rail-link[aria-current="page"] .rail-icon {
    background: linear-gradient(180deg, #1a5a58, var(--ink));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 18px rgba(15, 63, 62, 0.28);
  }
}

/* ---- Glass lens: the current section is marked by a sliding glass pill -- */
.rail-nav {
  position: relative;
}

.nav-lens {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.18) 48%, rgba(255, 255, 255, 0.32) 100%),
    rgba(17, 76, 76, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 6px rgba(17, 76, 76, 0.1),
    0 8px 22px rgba(15, 63, 62, 0.16),
    0 1px 3px rgba(15, 63, 62, 0.1);
  opacity: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  backdrop-filter: blur(10px) saturate(180%);
  transition:
    transform 460ms cubic-bezier(0.3, 1.35, 0.45, 1),
    width 300ms ease,
    height 300ms ease,
    opacity 200ms ease;
}

.nav-lens.no-anim {
  transition: none;
}

.rail-nav > a,
.tabbar > a {
  position: relative;
  z-index: 1;
}

@media (min-width: 980px) {
  .rail-link[aria-current="page"] .rail-icon {
    background: transparent;
    color: var(--ink);
    box-shadow: none;
  }

  .rail-link[aria-current="page"] {
    color: var(--ink);
    font-weight: 700;
  }

  .rail-link[aria-current="page"]:hover .rail-icon,
  .rail-link:hover .rail-icon {
    background: transparent;
    box-shadow: none;
  }

  .rail-link:hover {
    color: var(--ink);
  }
}

@media (max-width: 979px) {
  .tabbar a[aria-current="page"] {
    background: transparent;
    box-shadow: none;
    color: var(--ink);
  }

  .tabbar .nav-lens {
    border-radius: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-lens {
    transition: opacity 1ms;
  }
}
