﻿
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@500;600;700&display=swap");

:root {
  --bg: #f5efe7;
  --bg-strong: #efe3d4;
  --surface: rgba(255, 249, 241, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(46, 32, 17, 0.12);
  --line-strong: rgba(46, 32, 17, 0.18);
  --ink: #231b15;
  --muted: #6f6358;
  --accent: #d95d31;
  --accent-strong: #b94a24;
  --accent-soft: rgba(217, 93, 49, 0.13);
  --ok: #257357;
  --ok-soft: rgba(37, 115, 87, 0.12);
  --danger: #b63c35;
  --danger-soft: rgba(182, 60, 53, 0.12);
  --soft: rgba(46, 32, 17, 0.06);
  --shadow-lg: 0 30px 80px rgba(76, 50, 22, 0.14);
  --shadow-md: 0 18px 38px rgba(76, 50, 22, 0.1);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --font-display: "Unbounded", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  background:
    radial-gradient(circle at top left, rgba(255, 180, 118, 0.55), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(255, 221, 164, 0.42), transparent 28%),
    linear-gradient(180deg, #fbf6ef 0%, var(--bg) 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

a {
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(46, 32, 17, 0.14);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.86rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  min-height: 6.4rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(217, 93, 49, 0.55);
  box-shadow: 0 0 0 4px rgba(217, 93, 49, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

label {
  display: grid;
  gap: 0.45rem;
}

label > span {
  font-size: 0.92rem;
  font-weight: 600;
}

code {
  font-family: "Cascadia Code", "Consolas", monospace;
}

.shell {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.45;
}

.aurora-a {
  width: 26rem;
  height: 26rem;
  top: -8rem;
  left: -6rem;
  background: rgba(234, 110, 55, 0.22);
}

.aurora-b {
  width: 24rem;
  height: 24rem;
  top: 12rem;
  right: -5rem;
  background: rgba(233, 182, 90, 0.18);
}

.page,
.auth-page {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-strong);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
.brand-title,
.workspace-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.lede,
.micro-copy,
.brand-copy,
.workspace-copy,
.entity-header p,
.empty-state p,
.audit-entry p,
.status-panel,
.detail-list span,
.metric-card small,
.ghost-link,
.topbar-actions,
.card-head span {
  color: var(--muted);
}

.micro-copy {
  font-size: 0.9rem;
}

.heading-with-help,
.label-with-help {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
}

.help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 32, 17, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
  align-self: center;
}

.help-tooltip-bubble {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(100% + 0.7rem);
  width: min(16rem, 70vw);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(46, 32, 17, 0.12);
  background: rgba(35, 27, 21, 0.96);
  color: rgba(255, 249, 241, 0.98);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, 0.35rem);
  overflow-wrap: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.help-tooltip-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0.7rem;
  height: 0.7rem;
  background: rgba(35, 27, 21, 0.96);
  transform: translate(-50%, -50%) rotate(45deg);
  border-right: 1px solid rgba(46, 32, 17, 0.12);
  border-bottom: 1px solid rgba(46, 32, 17, 0.12);
}

.help-tooltip:hover .help-tooltip-bubble,
.help-tooltip:focus-visible .help-tooltip-bubble,
.help-tooltip:focus .help-tooltip-bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-link,
.icon-button,
.nav-link {
  border-radius: 8px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-link,
.nav-link {
  padding: 0.88rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: normal;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #ed7a3a 100%);
  box-shadow: 0 14px 34px rgba(217, 93, 49, 0.28);
}

.secondary-action,
.ghost-link,
.nav-link,
.icon-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.danger-action {
  color: #fff;
  background: linear-gradient(135deg, var(--danger) 0%, #d2574a 100%);
  box-shadow: 0 14px 34px rgba(182, 60, 53, 0.22);
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
.ghost-link:hover,
.nav-link:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.compact,
.compact-link {
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
}

.icon-button {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 800;
}

.status-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--soft);
}

.status-chip.is-ok,
.tag.is-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-chip.is-danger,
.tag.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.is-muted,
.tag.is-soft {
  background: rgba(46, 32, 17, 0.08);
  color: var(--muted);
}

.tag.is-accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.stack-form,
.detail-list,
.audit-feed,
.section-stack,
.nav-stack,
.sidebar-quick,
.portal-grid,
.account-grid,
.entity-grid,
.metric-strip,
.toolbar,
.switch-grid,
.stat-grid {
  display: grid;
  gap: 0.75rem;
}
.auth-shell {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-page {
  width: min(720px, 100%);
  display: grid;
  gap: 1.4rem;
}

.auth-hero,
.auth-card,
.surface-card,
.metric-card,
.entity-card,
.sidebar,
.modal-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.auth-hero,
.auth-card,
.surface-card,
.metric-card,
.entity-card,
.modal-card {
  border-radius: var(--radius-lg);
}

.auth-hero,
.auth-card {
  padding: 1.6rem;
}

.auth-hero {
  display: grid;
  gap: 0.9rem;
}

.auth-hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

.auth-card .stack-form {
  margin-top: 1rem;
}

.auth-support-grid,
.auth-card-grid {
  display: grid;
  gap: 1rem;
}

.auth-support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
}

.auth-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-support-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(46, 32, 17, 0.08);
  box-shadow: 0 12px 24px rgba(72, 48, 24, 0.04);
}

.auth-support-card p {
  color: var(--muted);
  line-height: 1.6;
}

.compact-support-card {
  padding: 0.9rem 1rem;
}

.auth-mini-checklist,
.auth-inline-links {
  display: grid;
  gap: 0.8rem;
}

.auth-inline-links {
  margin-top: 1rem;
}

.auth-error,
.info-box {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.auth-error {
  background: rgba(182, 60, 53, 0.08);
  border: 1px solid rgba(182, 60, 53, 0.22);
  color: var(--danger);
}

.info-box {
  background: rgba(217, 93, 49, 0.08);
  border: 1px solid rgba(217, 93, 49, 0.18);
}

.dashboard-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  gap: 1rem;
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 1.4rem;
}

.sidebar {
  position: sticky;
  top: 1.2rem;
  align-self: start;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.brand-block,
.workspace-topbar,
.section-panel,
.portal-page,
.metric-card,
.entity-card,
.surface-card {
  position: relative;
  min-width: 0;
}

.brand-block {
  display: grid;
  gap: 0.9rem;
  padding: 1.35rem 1.25rem 1.45rem;
  border-radius: calc(var(--radius-xl) + 4px);
  background:
    radial-gradient(circle at top right, rgba(255, 195, 130, 0.28), transparent 36%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.97) 0%, rgba(247, 236, 222, 0.92) 100%);
  border: 1px solid rgba(46, 32, 17, 0.1);
  box-shadow: 0 20px 40px rgba(76, 50, 22, 0.12);
  overflow: hidden;
}

.brand-block::after {
  content: "";
  position: absolute;
  width: 11rem;
  height: 11rem;
  right: -3rem;
  bottom: -5rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 93, 49, 0.18) 0%, rgba(217, 93, 49, 0) 72%);
  pointer-events: none;
}

.brand-block > * {
  position: relative;
  z-index: 1;
}

.brand-block .eyebrow {
  letter-spacing: 0.14em;
}

.brand-title {
  max-width: 12ch;
  font-size: clamp(1.65rem, 2.5vw, 2.3rem);
  line-height: 1.06;
  margin-top: 0.2rem;
}

.brand-copy,
.workspace-copy,
.lede {
  line-height: 1.65;
}

.brand-copy {
  max-width: 28ch;
  font-size: 0.98rem;
}

.nav-stack {
  gap: 0.7rem;
}

.nav-link {
  width: 100%;
  text-align: left;
  font-weight: 700;
}

.nav-link.is-active {
  background: var(--accent-soft);
  border-color: rgba(217, 93, 49, 0.2);
  color: var(--accent-strong);
}

.sidebar-quick {
  gap: 0.75rem;
}

.workspace {
  display: grid;
  gap: 0.75rem;
}

.workspace-topbar,
.section-panel,
.surface-card,
.entity-card,
.metric-card,
.portal-page {
  padding: 1rem;
}

.workspace-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 89px;
  padding-block: 0.65rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.workspace-title {
  font-size: clamp(1.25rem, 1.6vw, 1.65rem);
  margin-top: 0;
}

.topbar-actions,
.section-actions,
.chip-row,
.entity-actions,
.current-admin,
.portal-topbar,
.modal-actions,
.form-foot {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.metric-card strong {
  display: block;
  margin-top: 0.55rem;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1.08;
  overflow-wrap: break-word;
}

.metric-card span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.metric-card {
  text-align: left;
  overflow-wrap: anywhere;
}

.metric-card-link {
  width: 100%;
  display: grid;
  gap: 0.3rem;
  align-content: start;
  padding: 0.95rem;
  height: 100%;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.metric-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 93, 49, 0.2);
  box-shadow: 0 22px 42px rgba(76, 50, 22, 0.14);
}

.metric-card-link:focus-visible {
  outline: none;
  border-color: rgba(217, 93, 49, 0.5);
  box-shadow: 0 0 0 4px rgba(217, 93, 49, 0.12), 0 20px 38px rgba(76, 50, 22, 0.12);
}

.metric-card-link:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-lg);
}

.metric-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.metric-card-link:disabled .metric-card-action {
  color: var(--muted);
}

.section-panel {
  display: grid;
  gap: 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.section-panel[hidden] {
  display: none;
}

.section-heading,
.card-head,
.entity-header,
.audit-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.section-heading {
  width: 100%;
  min-height: 0;
}

.section-heading > div,
.card-head > div,
.entity-header > div,
.audit-topline > div {
  min-width: 0;
}

.section-heading > div:first-child,
.card-head > div:first-child {
  flex: 1 1 auto;
}

.section-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.entity-actions,
.modal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.entity-actions > *,
.modal-actions > * {
  width: 100%;
}

.section-heading h3,
.card-head h3,
.card-head h4,
.entity-header h4 {
  margin-bottom: 0.2rem;
}

.overview-grid,
.account-grid,
.entity-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
}

.overview-state-list,
.overview-next-list {
  display: grid;
  gap: 0.85rem;
}

.readiness-card,
.next-step-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(46, 32, 17, 0.08);
  box-shadow: 0 12px 26px rgba(72, 48, 24, 0.05);
}

.readiness-card p,
.next-step-card p {
  color: var(--muted);
  line-height: 1.6;
}

.wide-card {
  grid-column: 1 / -1;
}

.surface-card,
.entity-card {
  display: grid;
  gap: 1rem;
}

.entity-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(72, 48, 24, 0.08);
}

.toolbar {
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 0.7fr));
  align-items: end;
}

.toolbar input,
.toolbar select {
  height: 44px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid div,
.detail-list div,
.status-panel {
  min-width: 0;
  padding: 0.88rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(46, 32, 17, 0.08);
}

.stat-grid span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-grid strong,
.status-panel strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.detail-list {
  gap: 0.7rem;
}

.audit-feed {
  gap: 0.85rem;
}

.audit-entry,
.empty-state,
.preset-detail-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.empty-state {
  text-align: left;
}

.compact-empty {
  padding: 1rem;
}

.check-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.7rem;
}

.switch-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.switch-row input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.field-pair {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(170px, 0.8fr);
  align-items: center;
}

.field-pair.is-disabled {
  opacity: 0.72;
}
.form-foot {
  justify-content: space-between;
}

.slim-form {
  gap: 0.9rem;
}

.portal-shell .page {
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.portal-page {
  display: grid;
  gap: 1rem;
  border-radius: var(--radius-xl);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.portal-topbar {
  justify-content: space-between;
}

.portal-compact-topbar {
  padding: 0;
}

.hero.compact {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.hero.compact h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.94;
  margin-top: 0.45rem;
}

.portal-hero-slim {
  padding: 1.1rem 1.2rem;
}

.portal-hero-slim h1 {
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

.portal-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-section-tabs {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-section-tabs-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  font-weight: 800;
  text-align: left;
  overflow-wrap: break-word;
}

.portal-tab span {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  flex: 0 0 auto;
}

.portal-tab.is-active {
  color: var(--ink);
  background: rgba(255, 247, 238, 0.95);
  border-color: rgba(217, 93, 49, 0.25);
  box-shadow: 0 14px 30px rgba(217, 93, 49, 0.1);
}

.portal-tab.is-active span {
  color: #fff;
  background: var(--accent);
}

.portal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.portal-grid-single {
  grid-template-columns: 1fr;
}

[data-portal-panel][hidden] {
  display: none;
}

.portal-auth-page {
  grid-template-columns: 1fr;
}

.portal-status-list {
  gap: 0.8rem;
}

.connect-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
}

.connect-layout-compact {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.connect-toolbar {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.connect-summary-card {
  display: grid;
  gap: 0.8rem;
  background:
    radial-gradient(circle at top right, rgba(255, 195, 130, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(250, 241, 232, 0.9) 100%);
  border-color: rgba(217, 93, 49, 0.14);
}

.connect-summary-card .card-head {
  gap: 0.75rem;
}

.connect-summary-card .chip-row {
  gap: 0.55rem;
}

.artifact-grid {
  display: grid;
  gap: 1rem;
}

.artifact-card textarea {
  min-height: 8rem;
}

.artifact-card-compact {
  gap: 0.85rem;
}

.artifact-card-compact textarea {
  min-height: 7rem;
  max-height: 12rem;
}

.artifact-snippet {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(46, 32, 17, 0.06);
  border: 1px solid rgba(46, 32, 17, 0.08);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.artifact-details {
  display: grid;
  gap: 0.7rem;
}

.artifact-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.artifact-qr-panel {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(164px, 184px) minmax(0, 1fr);
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(46, 32, 17, 0.08);
}

.compact-qr-panel {
  grid-template-columns: 132px minmax(0, 1fr);
  padding: 0.8rem;
}

.compact-qr-panel .artifact-qr-frame {
  min-height: 124px;
}

.compact-qr-panel .artifact-qr-frame img {
  width: min(100%, 124px);
}

.artifact-qr-frame {
  display: grid;
  place-items: center;
  min-height: 164px;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid rgba(46, 32, 17, 0.08);
}

.artifact-qr-frame img {
  width: min(100%, 176px);
  height: auto;
  display: block;
}

.artifact-qr-copy {
  display: grid;
  gap: 0.45rem;
}

.artifact-qr-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.artifact-selected {
  border-color: rgba(217, 93, 49, 0.28);
  box-shadow: 0 18px 36px rgba(217, 93, 49, 0.12);
}

.device-guide-panel {
  display: grid;
  gap: 1rem;
}

.device-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.device-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.device-list {
  display: grid;
  gap: 1rem;
}

.device-card {
  cursor: pointer;
}

.device-card-active {
  border-color: rgba(217, 93, 49, 0.28);
  box-shadow: 0 18px 36px rgba(217, 93, 49, 0.12);
}

.device-card .entity-actions {
  margin-top: 0.2rem;
}

.device-form-note,
.is-using-shared-settings {
  position: relative;
}

.is-using-shared-settings select:disabled,
.is-using-shared-settings input:disabled {
  background: rgba(246, 241, 234, 0.78);
}

.surface-subcard {
  min-width: 0;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.portal-rules-card {
  margin-top: 1rem;
}

.portal-auth-compact {
  width: min(760px, 100%);
}

.portal-login-card,
.portal-login-grid {
  display: grid;
  gap: 1rem;
}

.portal-login-grid {
  grid-template-columns: 1fr;
}

.preset-builder-card {
  display: grid;
  gap: 1rem;
}

.preset-builder-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.file-import-control input {
  padding: 0.82rem 0.95rem;
  cursor: pointer;
}

.preset-hint-box {
  display: grid;
  gap: 0.4rem;
}

.preset-hint-box p {
  color: inherit;
  line-height: 1.65;
}

.preset-rule-summary {
  min-height: 2.25rem;
}

.preset-rule-preview {
  display: grid;
  gap: 0.9rem;
}

.preset-rule-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.preset-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.58rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(46, 32, 17, 0.08);
}

.preset-rule-domain {
  font-weight: 700;
  color: var(--ink);
}

.preset-rule-errors {
  gap: 0.55rem;
}

.usage-analytics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.usage-chart {
  display: grid;
  gap: 0.65rem;
}

.usage-timeline {
  display: grid;
  gap: 0.7rem;
}

.usage-timeline-wide {
  min-height: 420px;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.timeline-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  display: inline-block;
}

.timeline-dot.total,
.timeline-line.total {
  color: var(--accent);
  background: var(--accent);
  stroke: var(--accent);
}

.timeline-dot.admin,
.timeline-line.admin {
  color: #2468a5;
  background: #2468a5;
  stroke: #2468a5;
}

.timeline-dot.user,
.timeline-line.user {
  color: #40916c;
  background: #40916c;
  stroke: #40916c;
}

.timeline-dot.new-users,
.timeline-line.new-users {
  color: #7b5b2f;
  background: #7b5b2f;
  stroke: #7b5b2f;
}

.timeline-canvas {
  width: 100%;
  min-height: 250px;
}

.timeline-canvas svg {
  width: 100%;
  height: 100%;
}

.timeline-line {
  fill: none;
  stroke-width: 2.2;
  opacity: 0.9;
}

.timeline-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.usage-bar-row {
  display: grid;
  gap: 0.45rem;
}

.usage-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.usage-bar-meta span,
.usage-bar-row small {
  color: var(--muted);
}

.usage-bar-track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(46, 32, 17, 0.08);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #ed7a3a 100%);
}

.table-shell {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 1rem;
  display: grid;
  place-items: center;
  background: rgba(24, 18, 13, 0.34);
  backdrop-filter: blur(8px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(740px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 1.4rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.modal-body {
  display: grid;
  gap: 1rem;
}

.modal-copy {
  line-height: 1.6;
  color: var(--muted);
}

.toast-region {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.75rem;
  width: min(380px, calc(100% - 2rem));
}

.toast {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: var(--shadow-md);
}

.toast-success {
  border-color: rgba(37, 115, 87, 0.2);
}

.toast-error {
  border-color: rgba(182, 60, 53, 0.2);
}

.toast-info {
  border-color: rgba(46, 32, 17, 0.14);
}

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

.hidden {
  display: none !important;
}

.hidden-desktop {
  display: none;
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(24, 18, 13, 0.35);
  backdrop-filter: blur(3px);
}

@media (max-width: 1240px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metric-strip,
  .portal-metrics,
  .portal-section-tabs,
  .overview-grid,
  .account-grid,
  .entity-grid,
  .auth-support-grid,
  .auth-card-grid,
  .portal-grid,
  .usage-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar,
  .stat-grid,
  .switch-grid,
  .field-pair,
  .hero.compact,
  .connect-layout,
  .connect-toolbar,
  .artifact-qr-panel,
  .preset-builder-grid,
  .device-workspace {
    grid-template-columns: 1fr;
  }

  .entity-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  }
}

@media (max-width: 860px) {
  .dashboard-layout,
  .portal-shell .page {
    width: min(100% - 1rem, 100%);
  }

  .workspace-topbar,
  .section-heading,
  .card-head,
  .entity-header,
  .portal-topbar,
  .topbar-actions,
  .entity-actions,
  .form-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-strip,
  .portal-metrics,
  .portal-section-tabs,
  .overview-grid,
  .account-grid,
  .entity-grid,
  .auth-support-grid,
  .auth-card-grid,
  .portal-grid,
  .usage-analytics-grid {
    grid-template-columns: 1fr;
  }

  .hidden-desktop {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: min(86vw, 340px);
    height: 100vh;
    border-radius: 0;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    overflow-y: auto;
  }

  .sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .section-heading {
    min-height: auto !important;
  }
}

@media (max-width: 560px) {
  .dashboard-layout,
  .portal-shell .page,
  .auth-page {
    width: min(100% - 0.75rem, 100%);
  }

  .workspace-topbar,
  .section-panel,
  .surface-card,
  .entity-card,
  .metric-card,
  .sidebar,
  .auth-card,
  .auth-hero,
  .hero.compact,
  .modal-card {
    padding: 1rem;
  }

  .toast-region {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }

  .help-tooltip-bubble {
    left: auto;
    right: -0.25rem;
    width: min(18rem, calc(100vw - 2rem));
    transform: translate(0, 0.35rem);
  }

  .help-tooltip-bubble::after {
    left: auto;
    right: 0.45rem;
    transform: translate(0, -50%) rotate(45deg);
  }

  .help-tooltip:hover .help-tooltip-bubble,
  .help-tooltip:focus-visible .help-tooltip-bubble,
  .help-tooltip:focus .help-tooltip-bubble {
    transform: translate(0, 0);
  }
}
