/* Staff office shell. The public site does not load this file. */

body.admin {
  --tide: #187a9c;
  --tide-dark: #126582;
  --paper: #eef3f6;
  --ink-2: #314049;
  --danger: #9d2f2f;
  color-scheme: light;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.admin.is-app {
  background:
    radial-gradient(900px 380px at 100% -8%, rgba(106, 186, 219, 0.2), transparent 58%),
    var(--paper);
}

body.admin :focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
}

body.admin input:focus-visible,
body.admin textarea:focus-visible,
body.admin .pick-button:focus-visible {
  outline: none;
  border-color: var(--tide);
  box-shadow: 0 0 0 4px rgba(24, 122, 156, 0.18);
}

/* Sign in */

.auth-scene {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  color: #f4fbfd;
  background: linear-gradient(165deg, #1a6480 0%, #072733 68%);
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(143, 212, 238, 0.22);
  filter: blur(2px);
}

.auth-aside::before {
  width: 280px;
  height: 280px;
  top: -70px;
  left: -50px;
  animation: floaty 16s ease-in-out infinite alternate;
}

.auth-aside::after {
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: -160px;
  background: rgba(106, 186, 219, 0.2);
  animation: floaty 12s ease-in-out infinite alternate-reverse;
}

.auth-aside-inner { position: relative; z-index: 1; max-width: 440px; }

.auth-mark {
  margin: 0 0 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  color: rgba(244, 251, 253, 0.72);
}

.auth-display {
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.auth-lead {
  margin: 14px 0 0;
  max-width: 28em;
  color: rgba(244, 251, 253, 0.8);
  font-size: 17px;
}

.auth-pane {
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background:
    radial-gradient(640px 280px at 80% 0%, rgba(106, 186, 219, 0.18), transparent 62%),
    #f4f7f8;
}

body.admin .auth {
  width: min(420px, 100%);
  margin: 0;
  padding: 34px 32px 28px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(12, 42, 58, 0.1);
  animation: rise 0.5s ease both;
}

body.admin .auth h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-align: left;
}

body.admin .eyebrow {
  margin: 0 0 8px;
  color: var(--tide);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.admin .lede {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

body.admin .auth .lede { margin: 0 0 18px; }

body.admin.is-auth input[type="email"],
body.admin.is-auth input[type="password"],
body.admin.is-auth input[type="text"] {
  height: 48px;
  border-radius: 12px;
  border-color: #d5e0e6;
  background: #f7fafb;
}

body.admin.is-auth .auth button[type="submit"] {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border-radius: 14px;
}

body.admin.is-auth .auth button[type="submit"]:not(:disabled):not(.link-btn) {
  box-shadow: 0 10px 22px rgba(24, 122, 156, 0.28);
}

body.admin .code-input {
  letter-spacing: 0.42em;
  font-size: 22px;
  text-align: center;
  font-weight: 500;
}

body.admin .auth-alt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
}

/* Shell */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 16px;
  color: #e7f3f7;
  background:
    radial-gradient(420px 240px at 0% 100%, rgba(106, 186, 219, 0.22), transparent 70%),
    linear-gradient(180deg, #0e4458 0%, #072733 100%);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: #fff;
  text-decoration: none;
}

.side-brand strong,
.side-brand small { display: block; line-height: 1.2; }

.side-brand strong { font-weight: 600; letter-spacing: -0.02em; }

.side-brand small { color: rgba(255, 255, 255, 0.62); font-size: 13px; }

.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(160deg, #b7e4f4, #7ec8e4);
  color: #083044;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.side a,
.side-out {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}

.side svg,
.nav-toggle svg { width: 18px; height: 18px; flex: none; }

.side a:hover,
.side-out:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side a.is-on {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 #8fd0ea;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.side-foot form { margin: 0; }

.shell-main {
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 22px;
  background: rgba(238, 243, 246, 0.88);
  border-bottom: 1px solid rgba(12, 59, 78, 0.08);
  backdrop-filter: blur(14px);
}

.shell-bar-start { display: flex; align-items: center; gap: 10px; }

.shell-title { display: none; margin: 0; font-weight: 600; color: var(--heading); }

.nav-toggle,
.nav-scrim { display: none; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.who strong,
.who small { display: block; line-height: 1.25; }

.who strong { font-size: 14px; font-weight: 600; color: #16323f; }

.who small { color: #6d7c86; font-size: 12px; }

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7eef6;
  color: #0c3b4e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

body.admin .admin-main {
  width: 100%;
  max-width: 1200px;
  margin: 0;
  padding: 22px 28px 80px;
  flex: 1;
}

/* Cards, fields, buttons */

body.admin .panel {
  border: 0;
  border-radius: 22px;
  padding: 26px 26px 28px;
  margin: 0 0 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(12, 42, 58, 0.06);
  animation: rise 0.42s ease both;
}

body.admin.is-app .panel:nth-of-type(2) { animation-delay: 0.05s; }
body.admin.is-app .panel:nth-of-type(3) { animation-delay: 0.1s; }

body.admin .panel h1,
body.admin .manage-bar h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

body.admin .panel h2 { margin: 18px 0 12px; font-size: 20px; font-weight: 500; }

body.admin .panel-head h1,
body.admin .panel-head h2 { margin: 0; }

body.admin .panel-head { margin-bottom: 16px; align-items: flex-end; }

body.admin .notice {
  border-radius: 14px;
  margin: 0 0 16px;
}

body.admin input[type="text"],
body.admin input[type="email"],
body.admin input[type="password"],
body.admin input[type="date"],
body.admin input[type="time"],
body.admin input[type="tel"],
body.admin input:not([type]),
body.admin textarea,
body.admin .pick-button {
  border-radius: 12px;
  border-color: #d5e0e6;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.admin input[type="tel"] {
  display: block;
  width: 100%;
  height: 46px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid #d5e0e6;
}

body.admin textarea { border-radius: 14px; }

body.admin button {
  border-radius: 12px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

body.admin button:active:not(:disabled) { transform: translateY(1px); }

body.admin button[type="submit"]:not(:disabled):not(.btn-danger):not(.side-out):not(.link-btn) {
  background: var(--tide);
  color: #fff;
}

body.admin button[type="submit"]:not(:disabled):not(.btn-danger):not(.side-out):not(.link-btn):hover {
  background: var(--tide-dark);
  color: #fff;
}

body.admin .btn-primary {
  background: var(--tide);
  color: #fff;
}

body.admin .btn-primary:hover { background: var(--tide-dark); color: #fff; }

body.admin .btn-quiet,
body.admin a.btn-back,
body.admin button.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #d5e0e6;
  border-radius: 12px;
  background: #fff;
  color: #0c3b4e;
  text-decoration: none;
  font-size: 14.5px;
}

body.admin .btn-quiet:hover,
body.admin a.btn-back:hover,
body.admin button.btn-back:hover {
  border-color: #8ec6dc;
  background: #f3fafd;
  color: #0c3b4e;
}

body.admin a.btn-back::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

body.admin .btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f0c9c9;
}

body.admin .btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

body.admin .link-btn {
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tide-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

body.admin .link-btn:hover { background: transparent; color: #0c3b4e; }

body.admin .secret { position: relative; display: block; }

body.admin label .secret { margin-top: 4px; }

body.admin .secret input { margin-top: 0; padding-right: 64px; }

body.admin .secret button {
  position: absolute;
  top: 0;
  right: 6px;
  height: 100%;
  width: auto;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tide-dark);
  font-size: 13px;
  font-weight: 600;
  transform: none;
}

body.admin .secret button:hover,
body.admin .secret button:active { background: transparent; color: #0c3b4e; transform: none; }

body.admin .pick-button:hover { background: #fff; color: var(--ink); border-color: var(--tide); }

body.admin .pick-list {
  border-radius: 14px;
  border-color: #d7e3ea;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(12, 42, 58, 0.14);
}

body.admin .pick.is-open .pick-list { animation: menu-in 0.16s ease; }

body.admin .pick-list button {
  border-radius: 8px;
  background: transparent;
  color: #16323f;
}

body.admin .pick-list button:hover,
body.admin .pick-list button.is-on { background: #eef7fb; color: #0c3b4e; }

/* Appointments */

body.admin .finder {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

body.admin .finder input {
  width: 240px;
  height: 46px;
  margin: 0;
  padding-left: 16px;
  border-radius: 999px;
}

body.admin .finder button { height: 46px; }

body.admin .message-finder { margin-top: 4px; }
body.admin .patient-dupe-toggle { margin: 8px 0 0; }
body.admin .patient-sub { margin: 18px 0 10px; font-size: 18px; font-weight: 500; }
body.admin .dupe-card {
  margin: 0 0 14px;
  padding: 16px 16px 14px;
  background: #f4f7fa;
  border-radius: 16px;
}
body.admin .dupe-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #5c6b76; }
body.admin .dupe-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
}
body.admin .dupe-card { min-width: 0; max-width: 100%; }
body.admin .dupe-row span { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
body.admin .dupe-card button { margin-top: 8px; }
body.admin .patient-list { display: grid; gap: 10px; min-width: 0; }
body.admin .patient-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e4eaf0;
  border-radius: 14px;
}
body.admin .patient-row > div { min-width: 0; flex: 1 1 auto; }
body.admin .patient-row strong,
body.admin .patient-row p { overflow-wrap: anywhere; }
body.admin .patient-row p { margin: 4px 0 0; color: #5c6b76; }
body.admin .patient-row form { margin: 0; flex: 0 0 auto; }
body.admin .patient-x {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}
body.admin .patient-x svg { width: 16px; height: 16px; }
body.admin .thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
body.admin .thread-top .back-row { margin: 0; }
body.admin .thread-top form { margin: 0; }
body.admin .thread-top .btn-danger { height: 36px; padding: 0 14px; }
body.admin .thread-keep { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 0 auto; }
body.admin .thread-keep form { margin: 0; }
body.admin .thread-keep button { height: 36px; padding: 0 14px; }

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.seg a {
  padding: 7px 13px;
  border-radius: 999px;
  background: #f3f6f8;
  color: #3d4c56;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.seg a:hover { background: #e5f3f8; color: #0c3b4e; }

.seg a.is-on { background: #0c3b4e; color: #fff; }

body.admin .visit-list { gap: 10px; }

body.admin .visit {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e6eef2;
  border-radius: 16px;
  background: #f8fbfc;
  color: var(--heading);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  animation: rise 0.4s ease both;
}

body.admin .visit:nth-child(1) { animation-delay: 0.02s; }
body.admin .visit:nth-child(2) { animation-delay: 0.05s; }
body.admin .visit:nth-child(3) { animation-delay: 0.08s; }
body.admin .visit:nth-child(4) { animation-delay: 0.11s; }
body.admin .visit:nth-child(5) { animation-delay: 0.14s; }
body.admin .visit:nth-child(6) { animation-delay: 0.17s; }
body.admin .visit:nth-child(7) { animation-delay: 0.2s; }
body.admin .visit:nth-child(8) { animation-delay: 0.23s; }

body.admin .visit:hover {
  transform: translateY(-2px);
  border-color: #b9d7e4;
  background: #fff;
  box-shadow: 0 10px 24px rgba(12, 42, 58, 0.08);
  color: var(--heading);
}

.when-chip {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e3eef3;
}

.when-chip b {
  display: block;
  color: #0c3b4e;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.when-chip span {
  display: block;
  margin-top: 3px;
  color: #6a7c86;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.admin .visit-who strong {
  display: block;
  overflow: hidden;
  color: var(--heading);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin .visit-who small,
body.admin .visit-meta {
  color: #6a7c86;
  font-size: 13.5px;
}

body.admin .status {
  justify-self: end;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e7f6ee;
  color: #0e6a42;
  letter-spacing: 0.04em;
}

body.admin .status.rejected,
body.admin .status.cancelled { background: #fdecec; color: #8d2a2a; }

.empty-state { padding: 42px 12px; text-align: center; color: #5c6c76; }

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
  font-size: 18px;
  font-weight: 500;
}

.empty-state p { margin: 0; }

/* Visit */

.back-row { margin: 0 0 14px; }

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

body.admin .visit-sheet .sheet-head { margin-top: 18px; }

.sheet-head .status { margin-top: 4px; }

body.admin .facts {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: transparent;
}

body.admin .facts div {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f8fa;
}

body.admin .facts .wide { grid-column: 1 / -1; }

body.admin .facts dt {
  color: #6d7c86;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.admin .facts dt::after { content: none; }

body.admin .facts dd { margin: 4px 0 0; color: var(--heading); font-weight: 500; }

body.admin .facts a { color: var(--tide-dark); text-decoration: none; }

body.admin .facts a:hover { text-decoration: underline; }

body.admin .facts .is-muted { color: #8b98a1; font-weight: 400; }

body.admin .action-row { align-items: center; }

.action-gap { flex: 1; min-width: 12px; }

body.admin .site-dialog {
  border-radius: 22px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 70px rgba(8, 28, 40, 0.28);
}

body.admin .site-dialog::backdrop {
  background: rgba(8, 24, 34, 0.5);
  backdrop-filter: blur(6px);
}

body.admin .site-dialog h2 { font-size: 26px; font-weight: 500; }

body.admin .dialog-x { border-radius: 50%; background: transparent; color: #818a91; }

body.admin .dialog-x:hover { background: #f2f4f7; color: #243038; }

body.admin .book-continue { justify-content: flex-end; }

body.admin .book-continue button { border-radius: 12px; }

body.admin .resched { align-items: start; }

body.admin .slot-pane {
  min-height: 220px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f8fa;
}

body.admin .slot-list button {
  border-radius: 10px;
  background: #fff;
  color: #0c3b4e;
}

body.admin .slot-list button:hover { border-color: var(--tide); background: #fff; color: #0c3b4e; }

body.admin .slot-list button.is-on,
body.admin .slot-list button.is-on:hover {
  background: var(--tide);
  border-color: var(--tide);
  color: #fff;
}

/* Locations */

body.admin .location-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
}

body.admin .location-fields > :nth-child(1) { grid-column: span 5; }
body.admin .location-fields > :nth-child(2) { grid-column: span 7; }
body.admin .location-fields > :nth-child(3),
body.admin .location-fields > :nth-child(4),
body.admin .location-fields > :nth-child(5) { grid-column: span 4; }

body.admin .panel:has(.hour-edit) {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  column-gap: 28px;
}

body.admin .loc-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.admin .loc-title { flex: 1 1 auto; }
body.admin .loc-title h2 { margin: 0; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a5a12;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.permanent { background: #fdecec; color: #8d2a2a; }

body.admin .location-head { flex-wrap: wrap; align-items: center; }

body.admin .location-head .btn-danger,
body.admin .closure-form button { height: 46px; }

body.admin .closure-form { flex: 1 1 380px; justify-content: flex-end; }
body.admin .closure-form .pick { width: min(420px, 100%); }
body.admin .closure-form .pick-list {
  left: auto;
  right: 0;
  width: max-content;
  min-width: 100%;
}
body.admin .closure-form .pick-list button {
  white-space: nowrap;
  height: auto;
  line-height: 1.35;
}

body.admin .hour-edit { gap: 6px; }
body.admin .panel:has(.hour-edit) .hour-edit { margin-top: 0; }

body.admin .hour-row {
  grid-template-columns: 42px 132px 132px;
  grid-template-areas:
    "day open tele"
    "day from to";
  gap: 6px 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f6f9fb;
  justify-content: start;
}

body.admin .hour-row > span:first-child { grid-area: day; align-self: center; }
body.admin .hour-row > .hour-open { grid-area: open; }
body.admin .hour-row > .hour-tele { grid-area: tele; justify-self: end; }
body.admin .hour-row > input[type="time"]:first-of-type { grid-area: from; }
body.admin .hour-row > input[type="time"]:last-of-type { grid-area: to; }
body.admin .hour-row input[type="time"] {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  box-sizing: border-box;
  margin: 0;
}

body.admin .hour-row:not(:has(input[name$="[is_open]"]:checked)) { background: transparent; color: #8b98a1; }

body.admin .hour-row:not(:has(input[name$="[is_open]"]:checked)) input[type="time"],
body.admin .hour-row:not(:has(input[name$="[is_open]"]:checked)) .hour-tele {
  opacity: 0.4;
  pointer-events: none;
}

body.admin .dates-col {
  max-width: 420px;
  padding: 16px;
  border-radius: 18px;
  background: #f6f9fb;
}

body.admin .panel:has(.hour-edit) > .dates-col { max-width: none; }

body.admin .dates-col h3 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }

body.admin .panel[id] { scroll-margin-top: 78px; }

body.admin .loc-address { margin: 0 0 6px; }

body.admin .block-cal-head button { border-radius: 50%; }

body.admin .block-cal-head button:hover { border-color: var(--tide); background: #fff; color: #0c3b4e; }

body.admin .block-day { border-radius: 10px; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }

body.admin .block-day:hover { border-color: var(--tide); background: #fff; color: #0c3b4e; }

body.admin .block-day.is-on,
body.admin .block-day.is-on:hover {
  background: var(--tide);
  border-color: var(--tide);
  color: #fff;
}

/* Staff, messages, audit */

body.admin .staff-create {
  display: block;
  margin: 0 0 18px;
  padding: 16px;
  border-radius: 18px;
  background: #f6f9fb;
}

.create-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 0.95fr 1.05fr;
  gap: 12px;
  align-items: end;
}

.create-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.create-actions .hint { margin: 0; }

body.admin .staff-head { display: none; }

body.admin .staff-row {
  grid-template-columns: minmax(0, 1fr) minmax(168px, 220px) auto;
  grid-template-areas:
    "who role state"
    "pass pass save";
  align-items: center;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #e6eef2;
  border-radius: 16px;
  background: #fff;
}

body.admin .staff-row {
  grid-template-areas:
    "who role state"
    "access access access"
    "tools tools save";
}
body.admin .staff-id { grid-area: who; }
body.admin .staff-row > .pick { grid-area: role; width: 100%; margin: 0; }
body.admin .staff-row > .access-picks,
body.admin .access-note { grid-area: access; margin-top: 4px; }
body.admin .staff-create .create-access { margin-top: 28px; }
body.admin .access-note { margin: 4px 0 0; color: #6d7c86; font-size: 14px; }
body.admin .access-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
body.admin .access-picks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
body.admin .access-picks label.is-locked {
  color: #8aa0ab;
}
body.admin .access-picks label.is-locked input {
  accent-color: #9bb0ba;
}
body.admin .copy-mail {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f6f9fb;
}
body.admin .copy-mail label { margin: 0; flex: 1 1 240px; }
body.admin .copy-mail .hint { flex-basis: 100%; margin: 0; }
body.admin .staff-status { grid-area: state; display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
body.admin .staff-tools { grid-area: tools; display: flex; flex-wrap: wrap; gap: 8px; }
body.admin .staff-row > button[type="submit"] { grid-area: save; justify-self: end; align-self: end; }

body.admin .pass-cell,
body.admin .staff-id,
body.admin .secret { min-width: 0; }

.staff-state {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #0e6a42;
  font-weight: 600;
}
.staff-state.is-off { color: #8d2a2a; }
body.admin .staff-status .btn-danger,
body.admin .staff-status .btn-quiet { min-height: 36px; padding: 6px 12px; }

.pass-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

body.admin .message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #e6eef2;
  border-radius: 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.admin .message:hover {
  border-color: #c5dbe6;
  box-shadow: 0 8px 20px rgba(12, 42, 58, 0.05);
}

body.admin .message .avatar { width: 42px; height: 42px; }

body.admin a.message {
  color: inherit;
  text-decoration: none;
}

body.admin a.message.is-new {
  background: #f3fafd;
  border-color: #b7d6e4;
}

body.admin a.message.is-new h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--tide);
  transform: translateY(-1px);
}

body.admin .message-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin .message a { color: var(--tide-dark); text-decoration: none; }

body.admin .message a:hover { text-decoration: underline; }

body.admin table { border-radius: 16px; overflow: hidden; }

body.admin th { background: #f5f8fa; }

body.admin tbody tr { transition: background 0.15s ease; }

body.admin tbody tr:hover td { background: #f3fafd; }

body.admin td.when { color: #5c6c76; font-size: 13px; white-space: nowrap; }

.audit-list { display: flex; flex-direction: column; gap: 8px; }

.audit-row {
  padding: 12px 14px;
  border: 1px solid #e6eef2;
  border-radius: 14px;
  background: #f8fbfc;
}

.audit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.audit-top time { color: #5c6c76; font-size: 13px; }

.audit-who { margin: 6px 0 0; color: var(--heading); font-weight: 500; }

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 4px 0 0;
  color: #6a7c86;
  font-size: 13.5px;
}

.audit-meta a { color: var(--tide-dark); text-decoration: none; }

.audit-meta a:hover { text-decoration: underline; }

.audit-action {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f2f7;
  color: #0c3b4e;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

body.admin .stats-wrap { position: relative; padding: 36px 22px 44px; }
body.admin .stats-gear {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  line-height: 0;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
body.admin .stats-gear svg { display: block; width: 20px; height: 20px; }
body.admin .stats-gear.is-off { color: #c4473a; }
body.admin .stats-gear.is-on { color: #1f8a65; }
body.admin .stats-gear:hover { background: rgba(21, 32, 51, 0.06); }
body.admin .stats-gear:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
body.admin .stats-gear:active:not(:disabled) { transform: none; }
body.admin #ga-dialog textarea { min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
body.admin #ga-dialog .hint { margin: 0 0 16px; }

body.admin .admin-main:has(.manage) {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  padding: 16px 28px 24px;
}

body.admin .manage { flex: 1; display: flex; flex-direction: column; min-height: 0; }

body.admin .manage-bar { align-items: flex-end; margin-bottom: 12px; }

body.admin .manage-bar p { max-width: 62em; }

body.admin .site-frame {
  flex: 1;
  height: auto;
  min-height: 640px;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(12, 42, 58, 0.1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes floaty {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-18px, -14px, 0); }
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.admin *,
  body.admin *::before,
  body.admin *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1100px) {
  .create-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .auth-scene { grid-template-columns: 1fr; }
  .auth-aside { min-height: 210px; align-items: flex-end; padding: 28px 24px; }
  .auth-display { font-size: 36px; }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    z-index: 40;
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-scrim { display: block; }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(8, 24, 34, 0.46);
  }
  body.admin .nav-scrim:hover { background: rgba(8, 24, 34, 0.46); }
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #d7e2e8;
    border-radius: 12px;
    background: #fff;
    color: #0c3b4e;
  }
  body.admin .nav-toggle:hover { background: #fff; color: #0c3b4e; border-color: #8ec6dc; }
  .shell-title { display: block; }
  .who-name { display: none; }
  body.admin .admin-main { padding: 18px 16px 64px; }
  body.admin .admin-main:has(.thread) { padding: 12px 16px 12px; }
  body.admin .thread-compose { grid-template-columns: minmax(0, 1fr) auto; }
  body.admin .thread-actions {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  body.admin .location-fields,
  body.admin .location-fields > * { grid-column: auto; }
  body.admin .location-fields,
  body.admin .staff-head,
  body.admin .staff-row,
  body.admin .facts,
  body.admin .resched,
  .create-grid { grid-template-columns: 1fr; }
  body.admin .staff-row {
    grid-template-areas:
      "who"
      "role"
      "state"
      "access"
      "tools"
      "save";
  }
  body.admin .visit {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      "when status"
      "who who";
    animation: none;
  }
  body.admin .when-chip { grid-area: when; }
  body.admin .visit-who { grid-area: who; min-width: 0; }
  body.admin .status {
    grid-area: status;
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
    align-self: center;
  }
  body.admin .staff-head { display: none; }
  body.admin .panel-head,
  .sheet-head,
  .create-actions { display: block; }
  body.admin .finder { margin-top: 12px; }
  body.admin .finder input { width: 100%; }
  .action-gap { display: none; }
  .create-actions .hint { margin-bottom: 10px; }
  body.admin .visit-meta,
  body.admin .status { justify-self: start; }
  body.admin .notice-compose,
  body.admin .notice-look { grid-template-columns: 1fr; }
  body.admin .notice-compose .notice-stage,
  body.admin .notice-compose .template-grid,
  body.admin .notice-compose .notice-fields { grid-column: auto; grid-row: auto; }
  body.admin .notice-stage { position: static; min-height: 280px; }
  body.admin .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin .hour-row input[type="time"] { width: 100%; min-width: 0; max-width: none; }
}

body.admin .holiday-add {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 8px 0 28px;
}

@media (max-width: 900px) {
  body.admin .holiday-add { grid-template-columns: 1fr; gap: 18px; }
}

body.admin .holiday-fields label { margin-bottom: 12px; }

body.admin .holiday-annual {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}

body.admin .holiday-annual input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

body.admin .holiday-list { margin-top: 8px; }

body.admin .holiday-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #e6eef2;
}

body.admin .holiday-row span {
  display: block;
  margin-top: 2px;
  color: #5c6b76;
  font-size: 14px;
}

body.admin input[type="number"] {
  display: block;
  width: 120px;
  height: 46px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid #d5e0e6;
  border-radius: 12px;
  background: #fff;
}

body.admin .template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
  padding: 0;
  border: 0;
}

body.admin .template-grid legend {
  margin-bottom: 8px;
  font-size: 14px;
  color: #5c6b76;
}

body.admin .template-card {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 0;
  padding: 8px 6px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

body.admin .template-card:has(input:checked) {
  border-color: #187a9c;
  background: #f3fafd;
}

body.admin .template-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

body.admin .notice-compose {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.72fr);
  gap: 22px 28px;
  align-items: start;
}

body.admin .notice-compose .notice-stage { grid-column: 1; grid-row: 1; }

body.admin .notice-compose .template-grid {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  margin: 0;
}

body.admin .notice-compose .notice-fields {
  grid-column: 1;
  grid-row: 2;
  padding-top: 16px;
}

body.admin .notice-look {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.admin .span-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 14px;
  padding: 0;
  border: 0;
}

body.admin .span-picks legend {
  width: 100%;
  margin-bottom: 4px;
  font-size: 14px;
  color: #5c6b76;
}

body.admin .span-picks label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

body.admin .span-picks input { width: 16px; height: 16px; margin: 0; }

body.admin .notice-stage {
  position: static;
  min-height: 420px;
  padding: 32px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 40%),
    linear-gradient(145deg, #d5e4ec, #f4efe6);
}

body.admin .notice-stage .site-notice,
body.admin .notice-stage .site-notice.has-photo,
body.admin .notice-stage .site-notice.t1,
body.admin .notice-stage .site-notice.t2,
body.admin .notice-stage .site-notice.t3,
body.admin .notice-stage .site-notice.t4,
body.admin .notice-stage .site-notice.t5,
body.admin .notice-stage .site-notice.t6,
body.admin .notice-stage .site-notice.t7,
body.admin .notice-stage .site-notice.t8,
body.admin .notice-stage .site-notice.t9,
body.admin .notice-stage .site-notice.t10 {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  transform: none;
}

body.admin .notice-photo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 2px 0 16px;
  padding: 10px 12px;
  border: 1px solid #e6eef2;
  border-radius: 16px;
  background: #f7fafb;
}

body.admin .notice-photo-row .notice-attach {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex: none;
}

body.admin .notice-photo-row .span-picks {
  flex: 1;
  margin: 0;
  min-width: 0;
}

body.admin .notice-attach .thread-pick {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: 1px solid #d5e0e6;
  border-radius: 12px;
  background: #f7fafb center / cover no-repeat;
  color: #314049;
  overflow: hidden;
  cursor: pointer;
}

body.admin .template-mini {
  display: grid;
  width: 100%;
  height: 68px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #d5e0e6;
  background: #fff;
  pointer-events: none;
}

body.admin .template-mini .mini-photo {
  background: linear-gradient(145deg, #8ec6dc, #0c3b4e) center / cover no-repeat;
}

body.admin .template-mini .mini-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 6px;
}

body.admin .template-mini strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

body.admin .template-mini i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.35;
}

body.admin .template-mini i:last-child { width: 62%; }

body.admin .template-mini.span-third { grid-template-columns: 1fr 2fr; }
body.admin .template-mini.span-half { grid-template-columns: 1fr 1fr; }
body.admin .template-mini.span-wide { grid-template-columns: 2fr 1fr; }

body.admin .template-mini.font-office { font-family: Manrope, "Segoe UI", sans-serif; }
body.admin .template-mini.font-editorial { font-family: "Iowan Old Style", Palatino, Georgia, serif; }
body.admin .template-mini.font-modern { font-family: "Avenir Next", "Segoe UI", sans-serif; }
body.admin .template-mini.font-display { font-family: Didot, "Bodoni MT", "Times New Roman", serif; }
body.admin .template-mini.font-soft { font-family: "Avenir Next", "Trebuchet MS", sans-serif; }

body.admin .template-mini.t2,
body.admin .template-mini.t4,
body.admin .template-mini.t8 { background: #0c3b4e; color: #fff; }
body.admin .template-mini.t6 { background: #1a1814; color: #f6f1e8; }
body.admin .template-mini.t1 { box-shadow: inset 0 3px 0 #187a9c; }
body.admin .template-mini.t3 { border-radius: 12px 4px 12px 12px; }
body.admin .template-mini.t7 { box-shadow: inset 0 0 0 5px #f4f8fb; }
body.admin .template-mini.t9 .mini-copy { align-items: center; text-align: center; }
body.admin .template-mini.t10 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
body.admin .template-mini.t10.span-third { grid-template-rows: 1fr 2fr; }
body.admin .template-mini.t10.span-half { grid-template-rows: 1fr 1fr; }
body.admin .template-mini.t10.span-wide { grid-template-rows: 2fr 1fr; }

body.admin .notice-list { margin-top: 28px; }

body.admin .notice-card {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #e6eef2;
  border-radius: 16px;
  background: #fff;
}

body.admin .notice-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  cursor: pointer;
}

body.admin .notice-card summary span { color: #5c6b76; font-size: 14px; }

body.admin .notice-card form { margin-top: 16px; }

body.admin .notice-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

body.admin .notice-actions .btn-danger { margin-left: auto; }

body.admin.is-app:has(.thread) {
  height: 100dvh;
  overflow: hidden;
}

body.admin.is-app:has(.thread) .shell,
body.admin.is-app:has(.thread) .shell-main {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.admin .admin-main:has(.thread) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 16px;
}

body.admin .thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}

body.admin .thread-head { flex: none; }

body.admin .thread-head h1 { margin-top: 18px; }

body.admin .thread-head .lede { margin-bottom: 0; }

body.admin .thread-head .notice { margin-top: 16px; }

body.admin .chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 20px;
}

body.admin .thread .chat {
  flex: 1;
  min-height: 0;
  margin: 12px 0 0;
  padding: 4px 4px 12px;
  overflow-y: auto;
  overflow-anchor: none;
}

body.admin .thread-compose {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e6eef2;
}

body.admin .thread-compose label { margin: 0; }

body.admin .thread-compose textarea { min-height: 72px; max-height: 140px; }

body.admin .thread-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.admin .thread-compose button[type="submit"] { margin: 0; height: 46px; }

body.admin .thread-clip,
body.admin .notice-clip {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #314049;
  cursor: pointer;
}

body.admin .thread-clip:hover,
body.admin .thread-clip.is-on,
body.admin .notice-clip:hover,
body.admin .notice-clip.is-on {
  background: #e5f3f8;
  color: var(--tide-dark);
}

body.admin .thread-clip:focus-within,
body.admin .notice-clip:focus-within {
  box-shadow: 0 0 0 4px rgba(24, 122, 156, 0.18);
}

body.admin .thread-clip svg,
body.admin .notice-clip svg { width: 22px; height: 22px; }

body.admin .thread-clip input,
body.admin .notice-clip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.admin .thread-picks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

body.admin .thread-picks[hidden] { display: none; }

body.admin .thread-compose .thread-pick {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: 1px solid #d5e0e6;
  border-radius: 12px;
  background: #f7fafb;
  color: #314049;
  overflow: hidden;
  cursor: pointer;
}

body.admin .thread-pick:hover {
  border-color: var(--tide);
  color: #314049;
}

body.admin .thread-pick.is-image {
  background-color: #e7eef2;
  background-size: cover;
  background-position: center;
}

body.admin .thread-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  display: block;
}

body.admin .thread-pick-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 8px 6px;
}

body.admin .thread-pick-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tide-dark);
}

body.admin .thread-pick-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  color: #5c6b76;
}

body.admin .thread-pick-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(12, 42, 58, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

body.admin .bubble-photo {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
  max-width: min(320px, 100%);
}

body.admin .bubble-photo img,
body.admin .bubble img {
  display: block;
  max-width: min(320px, 100%);
  margin-top: 8px;
  border-radius: 12px;
}

body.admin .bubble-photo img {
  width: 100%;
  margin-top: 0;
}

body.admin .bubble-photo:hover img {
  box-shadow: 0 0 0 2px var(--tide);
}

body.admin .bubble .file-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--tide-dark);
}

body.admin .file-warn,
body.admin .pdf-pop-card header p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid #ead7b4;
  border-radius: 999px;
  background: #fbf6ec;
  color: #8a5a12;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

body.admin .file-warn::before,
body.admin .pdf-pop-card header p::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5a12' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.6 21.2 19.6H2.8L12 3.6z'/%3E%3Cpath d='M12 9.4v4.6'/%3E%3Ccircle cx='12' cy='17.2' r='0.9' fill='%238a5a12' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.admin .pdf-pop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(12, 42, 58, 0.45);
}

body.admin .pdf-pop[hidden] { display: none; }

body.admin .pdf-pop-card {
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  height: min(860px, 100%);
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(12, 42, 58, 0.28);
}

body.admin .pdf-pop-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid #d5e0e8;
}

body.admin .pdf-pop-card strong { font-weight: 600; }

body.admin .pdf-pop-card header p {
  margin: 0;
  flex: 1 1 240px;
}

body.admin .pdf-pop-card header p[hidden] { display: none; }

body.admin .pdf-pop-close {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid #d5e0e8;
  background: #fff;
  color: var(--tide-dark);
}

body.admin .pdf-pop-close:hover { border-color: var(--tide); }

body.admin .pdf-pop-card iframe,
body.admin .pdf-pop-photo {
  flex: 1 1 auto;
  width: 100%;
  height: 0;
  min-height: 0;
  border: 0;
  background: #eef3f6;
}

body.admin .pdf-pop-card iframe { background: #525659; }

body.admin .pdf-pop-photo {
  object-fit: contain;
}

body.admin .pdf-pop-card iframe[hidden],
body.admin .pdf-pop-photo[hidden] { display: none; }

body.admin .bubble {
  max-width: min(640px, 92%);
  padding: 14px 16px;
  border-radius: 18px;
}

body.admin .bubble.in { align-self: flex-start; background: #f4f8fb; }

body.admin .bubble.out { align-self: flex-end; background: #e5f3f8; }

body.admin .bubble header {
  margin-bottom: 6px;
  color: #5c6b76;
  font-size: 12px;
}

body.admin .bubble p { margin: 0; }

@media (max-width: 900px) {
  body.admin .panel:has(.hour-edit) { display: block; }
  body.admin .hour-edit { width: 100%; min-width: 0; }
  body.admin .hour-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "day open"
      "from from"
      "to to"
      "tele tele";
  }
  body.admin .hour-row > .hour-open { justify-self: start; }
  body.admin .hour-row > .hour-tele { justify-self: start; }
  body.admin .hour-row > input[type="time"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.admin .location-head > .btn-danger {
    display: block;
    width: fit-content;
    margin: 16px 0 0 auto;
  }
  body.admin .panel:has(.hour-edit) > .dates-col { margin-top: 28px; }

  body.admin .notice-compose {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  body.admin .notice-compose .notice-stage,
  body.admin .notice-compose .template-grid,
  body.admin .notice-compose .notice-fields {
    width: 100%;
    min-width: 0;
    grid-column: auto;
    grid-row: auto;
    padding-top: 0;
  }
  body.admin .notice-stage { min-height: 260px; padding: 16px; }
  body.admin .notice-compose .template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  body.admin .template-card { padding: 6px 4px 8px; font-size: 11px; }
  body.admin .notice-photo-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  body.admin .notice-photo-row .span-picks { width: 100%; flex: none; }
  body.admin .notice-look { grid-template-columns: 1fr 1fr; }
  body.admin .notice-public {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 12px 14px;
    align-items: end;
  }
  body.admin .notice-public label { margin-bottom: 0; }
  body.admin .notice-public .holiday-annual { margin: 0 0 8px; }
  body.admin .notice-public input[type="number"] { width: 100%; }
}
