:root {
  color-scheme: light;
  --pine: #17362d;
  --pine-dark: #112b24;
  --pine-light: #254a3d;
  --paper: #f4f1e8;
  --surface: #fffcf5;
  --ink: #192c25;
  --muted: #53645b;
  --gold: #e7c78c;
  --sage: #e4ede4;
  --line: #dcd9ca;
  --control-line: #878a78;
  --error: #842f2c;
  --on-pine: #f8f3e7;
  --on-pine-muted: #d5dfd4;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
p, dl, dd, h1, h2, h3 { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button:disabled { cursor: wait; opacity: .62; }

:focus-visible {
  outline: 3px solid #366f58;
  outline-offset: 3px;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 5vw, 4rem);
  place-items: center;
  background: radial-gradient(ellipse at 50% 10%, #fcf9ee, transparent 65%), var(--paper);
}

.login-frame {
  display: grid;
  grid-template-columns: .94fr 1fr;
  max-width: 920px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 24px 75px #34342117, 0 3px 10px #3434210d;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 410px;
  padding: clamp(1.75rem, 4.5vw, 3.75rem);
  border-radius: 27px 0 0 27px;
  background: radial-gradient(ellipse at right top, #315849, transparent 75%), var(--pine-dark);
  color: var(--on-pine);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--on-pine);
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: .015em;
  line-height: 1;
}

.brand-lockup small {
  color: var(--on-pine-muted);
  font: 500 .875rem/1 system-ui, sans-serif;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 2.3rem;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid #e7c78c99;
  border-radius: .75rem;
  background: #ffffff08;
}

.brand-mark::before, .brand-mark::after {
  position: absolute;
  left: 50%;
  background: var(--gold);
  border-radius: 2px;
  content: '';
  transform: translateX(-50%);
}

.brand-mark::before { top: 22%; width: 2px; height: 55%; }
.brand-mark::after { top: 39%; width: 44%; height: 2px; }

.login-brand-copy {
  padding-top: 1.6rem;
  border-top: 1px solid #e7c78c77;
  color: var(--on-pine-muted);
}

.login-brand-title {
  margin-bottom: .8rem;
  color: var(--on-pine);
  font: 400 clamp(2.15rem, 5vw, 3.35rem)/1.04 var(--serif);
  text-wrap: balance;
}

.login-card {
  align-self: center;
  min-width: 0;
  padding: clamp(1.75rem, 5vw, 4rem);
}

.login-card h1, .dashboard-header h1, .section-header h2 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.14;
}

.login-card h1 { font-size: clamp(2.1rem, 4vw, 2.9rem); }
.login-card > p:first-of-type { margin-top: .5rem; color: var(--muted); }
#login-form { display: grid; gap: 1rem; margin-top: 1.55rem; }

.field { display: grid; gap: .35rem; min-width: 0; }
.field label { font-size: .875rem; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .56rem .75rem;
  border: 1px solid var(--control-line);
  border-radius: .65rem;
  background: #fffef9;
  color: var(--ink);
}

.field select { padding-right: 2rem; }

.button, .review-actions button, .staff-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: .54rem 1rem;
  border: 1px solid var(--control-line);
  border-radius: .7rem;
  background: var(--surface);
  color: var(--pine);
  font-size: .9rem;
  font-weight: 675;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
}

.button:hover:not(:disabled), .review-actions button:hover:not(:disabled), .staff-row button:hover:not(:disabled) {
  background: #eeeae0;
}

.button.button--primary, .review-actions button.button--primary, .staff-row button.button--primary {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--on-pine);
}

.button.button--primary:hover:not(:disabled), .review-actions button.button--primary:hover:not(:disabled) {
  background: var(--pine-light);
}

.button.button--danger, .review-actions button.button--danger, .staff-row button.button--danger {
  border-color: #b27871;
  color: var(--error);
}

.button.button--danger:hover:not(:disabled), .review-actions button.button--danger:hover:not(:disabled),
.staff-row button.button--danger:hover:not(:disabled) {
  background: #f5e3df;
}

.status-message:not(:empty) {
  margin-top: .75rem;
  padding: .65rem .85rem;
  border-radius: .65rem;
  background: var(--sage);
  color: var(--ink);
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.status-message[data-state='error'], .status-message.is-error {
  background: #f5e3df;
  color: var(--error);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  gap: 2rem;
  padding: 1.7rem 1.25rem 1.3rem;
  overflow: auto;
  background: linear-gradient(150deg, var(--pine), var(--pine-dark));
  color: var(--on-pine);
}

.sidebar :focus-visible { outline-color: var(--gold); }
.section-nav { display: grid; align-content: start; gap: .3rem; }
.section-nav a {
  display: flex;
  align-items: center;
  min-height: 2.7rem;
  padding: .35rem .75rem;
  border-radius: .65rem;
  color: var(--on-pine-muted);
  font-size: .925rem;
  font-weight: 600;
  text-decoration: none;
}

.section-nav a:hover, .section-nav a:focus-visible { background: #ffffff14; color: var(--on-pine); }
.section-nav a[aria-current='location'] { background: #ffffff19; color: var(--gold); }

@supports selector(body:has(main)) {
  .dashboard-layout:has(#connections-panel[hidden]) #nav-overview,
  .dashboard-layout:has(#reviews-panel[hidden]) #nav-reviews,
  .dashboard-layout:has(#staff-panel[hidden]) #nav-staff { display: none; }
}

.account { display: grid; gap: .75rem; padding-top: 1rem; border-top: 1px solid #ffffff2e; }
.account-identity { min-width: 0; }
.account-role { color: var(--gold); font-size: .8rem; font-weight: 650; }
.account-email { color: var(--on-pine-muted); font-size: .83rem; overflow-wrap: anywhere; }
.account-role:empty, .account-email:empty { display: none; }
.button.button--sign-out {
  justify-self: start;
  border-color: #b8c4ad78;
  background: #ffffff09;
  color: var(--on-pine);
}
.button.button--sign-out:hover:not(:disabled) { background: #ffffff1c; }

.skip-link {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  padding: .65rem .9rem;
  border-radius: .6rem;
  background: var(--surface);
  color: var(--pine);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.dashboard-content {
  min-width: 0;
  width: 100%;
  max-width: 90rem;
  padding: clamp(1.1rem, 4vw, 3.5rem);
}
.dashboard-content:focus { outline: 0; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.45rem;
  border-bottom: 1px solid var(--line);
}
.dashboard-header h1 { font-size: clamp(1.95rem, 4vw, 3.2rem); }
.dashboard-header .button { flex: 0 0 auto; }
.dashboard-section { margin-top: 2.05rem; scroll-margin-top: 1rem; }
.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .85rem 1rem;
  margin-bottom: .85rem;
}
.section-header h2 { font-size: clamp(1.65rem, 2.8vw, 2.1rem); }
.section-header p { margin-top: .22rem; color: var(--muted); font-size: .925rem; }
.field--filter { width: min(100%, 13.5rem); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.55rem, 1.5vw, .85rem);
}
.metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 7rem;
  padding: clamp(.75rem, 1.5vw, 1.15rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.metric dt { color: var(--muted); font-size: .855rem; font-weight: 650; line-height: 1.3; }
.metric dd {
  margin-top: .35rem;
  color: var(--ink);
  font: 400 clamp(1.65rem, 3.5vw, 2.65rem)/1.05 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}
.metric--primary { border-color: var(--pine-light); background: linear-gradient(135deg, var(--pine), var(--pine-light)); }
.metric--primary dt { color: var(--on-pine-muted); }
.metric--primary dd { color: var(--gold); }
.metric--total { border-color: #c8d6c8; background: var(--sage); }

.content-list { display: grid; gap: .65rem; }
.content-list:not(:empty) { margin-top: .7rem; }
.review-card, .staff-row, .empty-state {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}
.review-card > summary, .review-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .65rem;
  padding: .9rem 1rem;
  border-radius: .85rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.review-card > summary::-webkit-details-marker { display: none; }
.review-card > summary::before {
  width: .48rem;
  height: .48rem;
  margin-inline: .15rem .25rem;
  border-right: 2px solid #56725e;
  border-bottom: 2px solid #56725e;
  content: '';
  transform: rotate(-45deg);
}
.review-card[open] > summary::before { transform: rotate(45deg); }
.review-card > summary:hover { background: #f7f3e9; }
.review-card > summary > span:first-child { flex: 1 1 9rem; min-width: 0; }
.review-title { display: block; font-size: 1rem; font-weight: 675; overflow-wrap: anywhere; }
.review-meta { display: block; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.review-card .chip { margin-inline-start: auto; }
.chip {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: .45rem;
  background: var(--sage);
  color: var(--pine);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.3;
}
.chip--pending { background: #f3e7cb; color: #5d471e; }
.review-content { display: grid; gap: .65rem; padding: .9rem 1rem 1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.review-content > p { white-space: pre-wrap; }
.review-content img, .review-content video { display: block; max-width: 100%; height: auto; border-radius: .65rem; }
.review-content video:not([hidden]) { margin-top: .6rem; }
.review-content a { color: #2c634f; font-weight: 600; }
.review-content details > summary { cursor: pointer; }
.review-content form { display: grid; gap: .65rem; }
.review-content form > label { display: grid; justify-items: start; gap: .35rem; font-size: .875rem; font-weight: 650; }
.review-content form textarea {
  width: min(100%, 40rem);
  padding: .56rem .75rem;
  border: 1px solid var(--control-line);
  border-radius: .65rem;
  background: #fffef9;
  color: var(--ink);
  resize: vertical;
}
.review-content fieldset { display: grid; gap: .35rem; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .65rem; }
.review-content fieldset legend { padding-inline: .3rem; font-size: .875rem; font-weight: 650; }
.review-content fieldset label { display: flex; align-items: start; gap: .5rem; }
.review-content fieldset input { margin-top: .35rem; accent-color: var(--pine); }
.review-content form > [role='status']:empty { height: 0; }
.review-actions { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem; }
.review-actions .field { flex: 1 0 min(100%, 14rem); }

.staff-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}
.staff-form .field { flex: 1 1 14rem; max-width: 26rem; }
.staff-form .button { min-height: 2.85rem; }
.staff-note { margin-top: .45rem; color: var(--muted); font-size: .875rem; }
.staff-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding: .8rem 1rem; }
.staff-name { display: block; font-weight: 675; overflow-wrap: anywhere; }
.staff-role { display: block; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.empty-state { padding: .9rem 1rem; color: var(--muted); }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    grid-template: 'brand account' auto 'nav nav' auto / minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
    gap: .75rem 1rem;
    padding: .75rem 1rem .45rem;
  }
  .sidebar .brand-lockup { grid-area: brand; }
  .section-nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: .15rem .35rem; }
  .section-nav a { min-height: 2.55rem; }
  .account { grid-area: account; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: 0; border: 0; }
  .account-email { max-width: 15rem; }
  .button.button--sign-out { min-width: 0; min-height: 2.65rem; padding: .42rem .7rem; }
  .dashboard-header { padding-bottom: .95rem; }
  .dashboard-section { margin-top: 1.6rem; }
}

@media (max-width: 640px) {
  .login-frame { grid-template-columns: minmax(0, 1fr); max-width: 28rem; }
  .login-brand { min-height: 0; gap: 1.25rem; padding: 1.3rem 1.5rem; border-radius: 27px 27px 0 0; }
  .login-brand-copy { padding-top: .9rem; }
  .login-brand-title { margin-bottom: .4rem; font-size: 2rem; }
  .login-brand-copy p:last-child { font-size: .9rem; }
  .login-card { padding: 1.35rem 1.5rem 1.65rem; }
}

@media (max-width: 430px) {
  .sidebar { grid-template: 'brand' auto 'account' auto 'nav' auto / minmax(0, 1fr); }
  .account { justify-content: space-between; }
  .account-email { max-width: none; }
  .button.button--sign-out { justify-self: end; }
  .metric { min-height: 6rem; }
  .staff-form .button { width: 100%; }
}
