/* ============================================================
   TOAST & ROAST — Owner panel (#admin)
   Uses the same brand tokens as the public site: nothing here
   changes how the site itself looks.
   ============================================================ */

/* ---- Discreet owner entry point in the footer ---- */
.owner-link {
  color: var(--ink-500);
  text-decoration: none;
  opacity: .55;
  transition: opacity .18s ease, color .18s ease;
}
.owner-link:hover { opacity: 1; color: var(--olive-700); }

/* ---- Unpublished-changes bar (only the owner's device ever sees it) ---- */
.draft-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: var(--cream-100);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  font-size: 13px;
}
.draft-dot {
  width: 8px; height: 8px; flex: 0 0 auto;
  border-radius: 50%;
  background: #E2B23C;
}
.draft-text { flex: 1 1 auto; min-width: 0; }
.draft-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(252, 250, 244, .28);
  background: transparent;
  color: var(--cream-100);
  border-radius: var(--r-pill);
  padding: 6px 13px;
  font: inherit;
  font-weight: var(--w-semi);
  cursor: pointer;
  text-decoration: none;
}
.draft-btn:hover { background: rgba(252, 250, 244, .12); }
.draft-btn--go { background: var(--olive-500); border-color: var(--olive-500); }
.draft-btn--go:hover { background: var(--olive-400); }
body.is-admin .draft-bar,
body.is-admin .fab { display: none; }
@media (max-width: 560px) {
  .draft-bar { bottom: 12px; font-size: 12.5px; padding: 9px 10px 9px 13px; }
  .draft-text { display: none; }
}

/* ---- Lock screen ---- */
.adm-lock { display: flex; justify-content: center; padding: 32px 0 64px; }
.adm-lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  text-align: center;
}
.adm-lock-card .serif-h { margin: 0; }
.adm-lock-card .adm-input { text-align: center; letter-spacing: .35em; font-size: 18px; }
.adm-lock-err {
  margin: 0;
  font-size: 13px;
  font-weight: var(--w-semi);
  color: #A2432F;
}

/* ---- Panel shell ---- */
.adm {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--font-body);
  width: 100%;
}
.adm-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}
.adm-title {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: 30px;
  line-height: var(--lh-tight);
  color: var(--ink-900);
  margin: 0;
}
.adm-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-700); }
.adm-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-actions .btn { padding: 11px 16px; font-size: 14px; }
@media (min-width: 860px) {
  .adm-head { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .adm-actions { justify-content: flex-end; }
}

.adm-statusline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: var(--w-semi);
  color: var(--ink-500);
  padding-right: 4px;
}
.adm-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--olive-500);
}
.adm-dot.is-dirty { background: #E2B23C; }

/* ---- Tabs ---- */
.adm-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.adm-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: var(--w-semi);
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.adm-tab .ms { font-size: 19px; }
.adm-tab:hover { color: var(--olive-700); background: rgba(118, 122, 69, .06); }
.adm-tab.is-on { color: var(--olive-700); border-bottom-color: var(--olive-500); }

/* ---- Sections ---- */
.adm-panel { display: flex; flex-direction: column; gap: 20px; }
.adm-section {
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 720px) { .adm-section { padding: 24px; } }
.adm-section-head { display: flex; flex-direction: column; gap: 4px; }
.adm-h {
  font-family: var(--font-display);
  font-weight: var(--w-semi);
  font-size: 20px;
  color: var(--ink-900);
  margin: 0;
}
.adm-h3 {
  font-family: var(--font-body);
  font-weight: var(--w-bold);
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--olive-700);
  margin: 8px 0 0;
}
.adm-section-body { display: flex; flex-direction: column; gap: 14px; }
.adm-divider { height: 1px; background: var(--line); margin: 2px 0; }

/* ---- Rows & fields ---- */
.adm-row { display: flex; flex-direction: column; gap: 6px; }
.adm-label {
  font-size: 13px;
  font-weight: var(--w-bold);
  color: var(--ink-900);
  letter-spacing: .01em;
}
.adm-hint { font-size: 12.5px; line-height: 1.45; color: var(--ink-500); margin: 0; }
.adm-row--switch {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.adm-row--switch > div { display: flex; flex-direction: column; gap: 3px; }
.adm-row--icon { flex-direction: column; }

.adm-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--cream-0);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: var(--w-med);
  color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.adm-input::placeholder { color: var(--ink-500); font-weight: var(--w-reg); }
.adm-input:hover { border-color: var(--sage-300); }
.adm-input:focus {
  outline: none;
  border-color: var(--olive-500);
  box-shadow: 0 0 0 3px rgba(118, 122, 69, .16);
}
.adm-textarea { resize: vertical; line-height: 1.5; min-height: 76px; }
.adm-select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
                    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.adm-grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) { .adm-grid-2 { grid-template-columns: 1fr 1fr; } }
.adm-inline { display: flex; gap: 8px; }
.adm-inline .adm-select { flex: 1 1 auto; }
.adm-inline .adm-input:not(.adm-select) { flex: 0 0 110px; }

/* ---- Toggle switch ---- */
.adm-toggle {
  flex: 0 0 auto;
  width: 52px; height: 30px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--sand-200);
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, border-color .18s ease;
}
.adm-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cream-0);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease;
}
.adm-toggle.is-on { background: var(--olive-500); border-color: var(--olive-500); }
.adm-toggle.is-on .adm-toggle-knob { transform: translateX(22px); }

/* ---- Repeatable items ---- */
.adm-list { display: flex; flex-direction: column; gap: 12px; }
.adm-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream-50);
  overflow: hidden;
}
.adm-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  background: var(--sand-200);
  border-bottom: 1px solid var(--line);
}
.adm-item-title {
  font-size: 13.5px;
  font-weight: var(--w-bold);
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-item-tools { display: flex; gap: 4px; flex: 0 0 auto; }
.adm-item-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.adm-icon-btn {
  border: 0;
  background: transparent;
  border-radius: var(--r-xs);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-700);
  cursor: pointer;
}
.adm-icon-btn .ms { font-size: 19px; }
.adm-icon-btn:hover { background: rgba(38, 39, 26, .08); color: var(--ink-900); }
.adm-icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.adm-icon-btn--danger:hover { background: rgba(162, 67, 47, .12); color: #A2432F; }
/* Armed state: the first tap asks, the second tap deletes. */
.adm-icon-btn--danger.is-armed {
  width: auto;
  padding: 0 10px;
  gap: 4px;
  background: #A2432F;
  color: #fff;
}
.adm-icon-btn--danger.is-armed:hover { background: #8C3826; color: #fff; }
.adm-del-confirm { font-size: 13px; font-weight: 600; white-space: nowrap; }

.adm-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: flex-start;
  border: 1px dashed var(--sage-300);
  background: transparent;
  color: var(--olive-700);
  border-radius: var(--r-pill);
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: var(--w-semi);
  cursor: pointer;
}
.adm-add:hover { background: rgba(118, 122, 69, .08); border-style: solid; }
.adm-add .ms { font-size: 18px; }
.adm-add--inline { padding: 11px 18px; border-style: solid; }
.adm-add--file { position: relative; overflow: hidden; }
.adm-file {
  position: absolute; inset: 0;
  opacity: 0;
  width: 100%; height: 100%;
  cursor: pointer;
}

.adm-link {
  align-self: flex-start;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: var(--w-semi);
  color: var(--olive-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.adm-link:hover { color: var(--olive-700); }

/* ---- Tag list ---- */
.adm-taglist { display: flex; flex-direction: column; gap: 10px; }
.adm-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.adm-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sand-200);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 7px 6px 7px 14px;
  font-size: 13.5px;
  font-weight: var(--w-semi);
  color: var(--ink-900);
}
.adm-tag-x {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-500);
  display: inline-flex;
  padding: 2px;
  border-radius: 50%;
}
.adm-tag-x .ms { font-size: 16px; }
.adm-tag-x:hover { background: rgba(38, 39, 26, .1); color: var(--ink-900); }
.adm-tag-add { display: flex; gap: 8px; }
.adm-tag-input { flex: 1 1 auto; }

/* ---- Icon picker ---- */
.adm-iconpick { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.adm-iconpick-current {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--sage-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.adm-iconpick-current .ms { font-size: 26px; color: var(--olive-600); }
.adm-iconpick-current:hover { border-color: var(--olive-500); }
.adm-iconpick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream-0);
}
.adm-iconpick-btn {
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-700);
}
.adm-iconpick-btn .ms { font-size: 22px; }
.adm-iconpick-btn:hover { background: var(--sand-200); }
.adm-iconpick-btn.is-on {
  background: var(--olive-500);
  border-color: var(--olive-500);
  color: var(--on-olive);
}
.adm-iconpick-btn.is-on .ms { color: var(--on-olive); }

/* ---- Photos ---- */
.adm-imgrow { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.adm-imgrow + .adm-imgrow { border-top: 1px solid var(--line); padding-top: 18px; }
.adm-img { display: flex; gap: 16px; align-items: flex-start; }
.adm-img-preview {
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--sand-200);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
}
.adm-img-tools { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; min-width: 0; }

/* ---- Status / publish ---- */
.adm-status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--cream-0);
}
.adm-status .ms { font-size: 22px; }
.adm-status strong { font-size: 14.5px; color: var(--ink-900); }
.adm-status p { margin: 3px 0 0; }
.adm-status--draft { border-color: #E2B23C; background: rgba(226, 178, 60, .09); }
.adm-status--draft .ms { color: #9A6F12; }
.adm-status--clean .ms { color: var(--olive-500); }

.adm-btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.adm-btnrow .btn { flex: 1 1 auto; }
.adm-danger { color: #A2432F; }
.adm-danger:hover { background: rgba(162, 67, 47, .1); }

.adm-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream-0);
  overflow: hidden;
}
.adm-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  font-size: 14px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--line);
}
.adm-preview-row:last-child { border-bottom: 0; }
.adm-preview-row.is-strong {
  background: var(--sage-200);
  color: var(--ink-900);
  font-weight: var(--w-bold);
}

/* ---- Folds ---- */
.adm-fold {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream-0);
  overflow: hidden;
}
.adm-fold + .adm-fold { margin-top: 10px; }
.adm-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: var(--w-bold);
  font-size: 15px;
  color: var(--ink-900);
  list-style: none;
  user-select: none;
}
.adm-fold > summary::-webkit-details-marker { display: none; }
.adm-fold > summary:hover { background: var(--sand-200); }
.adm-fold > summary .ms { color: var(--olive-600); transition: transform .18s ease; }
.adm-fold[open] > summary { border-bottom: 1px solid var(--line); }
.adm-fold[open] > summary .ms { transform: rotate(180deg); }
.adm-fold-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

/* ---- Toast ---- */
.adm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: var(--cream-100);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--w-semi);
  box-shadow: var(--shadow-lg);
  animation: admToast .22s ease-out;
}
.adm-toast .ms { font-size: 20px; color: var(--olive-400); }
.adm-toast--error { background: #7A3323; }
.adm-toast--error .ms { color: #F0C4B8; }
@keyframes admToast {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) { .adm-toast { animation: none; } }
