/* Lumaris monochrome shield theme and responsive layout refinements. */
:root {
  color-scheme: dark;
  --bg: #050506;
  --bg-soft: #0a0a0d;
  --panel: #101013;
  --panel-2: #17171b;
  --panel-3: #222227;
  --line: rgba(225, 225, 235, .11);
  --line-strong: rgba(225, 225, 235, .2);
  --text: #f5f5f7;
  --muted: #a2a2ad;
  --muted-2: #74747f;
  --blue: #dedee5;
  --blue-2: #b9b9c3;
  --cyan: #eeeeF2;
  --shadow: 0 22px 70px rgba(0, 0, 0, .5);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  min-width: 320px;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  scrollbar-color: #55555d #09090b;
}

body {
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 720px 470px at 68% -17%, rgba(225, 225, 238, .09), transparent 67%),
    radial-gradient(ellipse 520px 360px at -12% 58%, rgba(175, 175, 190, .035), transparent 72%),
    #050506;
  color: var(--text);
}

::selection { background: rgba(235, 235, 244, .24); color: #fff; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(238, 238, 245, .78);
  outline-offset: 2px;
}

.button {
  min-height: 38px;
  border-color: rgba(225, 225, 235, .17);
  background: linear-gradient(145deg, #1b1b20, #121215);
  color: #eeeeF2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.button:hover {
  background: linear-gradient(145deg, #29292f, #19191e);
  border-color: rgba(245, 245, 250, .38);
  transform: translateY(-1px);
}
.button.primary {
  background: linear-gradient(135deg, #f3f3f6 0%, #bfc0c8 100%);
  border-color: #eeeeF2;
  color: #09090b;
  box-shadow: 0 8px 26px rgba(225, 225, 238, .13), inset 0 1px 0 rgba(255,255,255,.7);
}
.button.primary:hover {
  background: linear-gradient(135deg, #fff 0%, #d2d2d9 100%);
  border-color: #fff;
}
.button.danger {
  color: #ffb5bd;
  border-color: rgba(240, 120, 134, .28);
  background: rgba(160, 43, 59, .12);
}
.button.success {
  color: #9ce9cb;
  border-color: rgba(66, 201, 154, .25);
  background: rgba(34, 150, 107, .11);
}
.input, select, textarea {
  background: #0b0b0e;
  border-color: rgba(225, 225, 235, .16);
  color: var(--text);
}
.input:focus, select:focus, textarea:focus {
  border-color: rgba(235, 235, 243, .72);
  box-shadow: 0 0 0 3px rgba(225, 225, 238, .09);
}
label.field-label { color: #d5d5dc; }
.eyebrow, .nav-caption, .topbar-kicker { color: #85858f; }
.notice {
  border-color: rgba(220, 220, 232, .16);
  background: rgba(210, 210, 225, .055);
  color: #d0d0d8;
}
.notice.warning { border-color: rgba(233, 180, 95, .25); background: rgba(233, 180, 95, .07); color: #efd4a2; }
.notice.error { border-color: rgba(240, 120, 134, .25); background: rgba(240, 120, 134, .07); color: #ffb4bd; }
.notice.success { border-color: rgba(66, 201, 154, .25); background: rgba(66, 201, 154, .07); color: #9ce9cb; }
.pill.partial { color: #e0e0e7; border-color: rgba(225, 225, 235, .2); background: rgba(225, 225, 235, .07); }
code { color: #e0e0e7; background: rgba(225, 225, 235, .08); overflow-wrap: anywhere; }
.spinner { border-color: rgba(225,225,235,.16); border-top-color: #eeeeF2; }

.app-shell { min-height: 100vh; min-height: 100svh; }
.sidebar {
  background: rgba(7, 7, 9, .97);
  border-right-color: rgba(225, 225, 235, .11);
  box-shadow: 12px 0 36px rgba(0, 0, 0, .12);
}
.sidebar-brand strong { color: #f4f4f6; letter-spacing: .06em; }
.sidebar-brand small { color: #777781; }
.brand-mark {
  overflow: hidden;
  background: #08080a;
  border: 1px solid rgba(238, 238, 245, .3);
  box-shadow: 0 0 0 1px rgba(255,255,255,.035), 0 0 27px rgba(235,235,245,.13);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-mark.small { border-radius: 11px; }
.nav-link { color: #aaaab3; }
.nav-link:hover { background: rgba(235,235,245,.065); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(235,235,245,.13), rgba(235,235,245,.035));
  color: #fff;
  border-color: rgba(235,235,245,.19);
  box-shadow: inset 2px 0 0 rgba(245,245,250,.82), 0 0 22px rgba(235,235,245,.025);
}
.nav-link.active .nav-icon { color: #fff; }
.nav-icon { color: #858590; }
.sidebar-bot-card {
  background: linear-gradient(135deg, rgba(220,220,232,.075), rgba(220,220,232,.018));
  border-color: rgba(225,225,235,.13);
}
.bot-orb {
  overflow: hidden;
  background: #08080a;
  border: 1px solid rgba(238,238,245,.25);
  box-shadow: 0 0 17px rgba(235,235,245,.12);
}
.bot-orb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.owner-row { border-top-color: var(--line); }
.owner-avatar { background: #202024; border-color: rgba(225,225,235,.2); }
.icon-button { color: #b9b9c2; }
.icon-button:hover { background: rgba(225,225,235,.09); border-color: var(--line); color: #fff; }
.main-shell { min-width: 0; width: calc(100% - 246px); }
.topbar {
  background: rgba(7, 7, 9, .88);
  border-bottom-color: rgba(225,225,235,.11);
  backdrop-filter: blur(20px);
}
.topbar-kicker span { color: #c5c5ce; }
.connection-pill { color: #c3c3cb; }
.owner-chip { color: #d8d8df; }
.view-content { min-width: 0; }
.app-footer { color: #777781; }

.login-screen {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 50% 13%, rgba(230,230,242,.095), transparent 43%),
    radial-gradient(ellipse at 50% 70%, rgba(155,155,170,.035), transparent 56%),
    #050506;
}
.login-glow { background: rgba(230,230,240,.045); }
.login-card {
  border-color: rgba(230,230,240,.2);
  background: linear-gradient(150deg, rgba(19,19,23,.96), rgba(9,9,12,.96));
  box-shadow: 0 32px 110px rgba(0,0,0,.62), 0 0 65px rgba(230,230,240,.045);
}
.login-card .brand-mark { width: 76px; height: 76px; border-radius: 22px; }
.login-card .eyebrow { color: #c8c8d0; }
.login-card h1 span { color: #bdbdc7; }
.login-foot { color: #a4a4ae; }
.profile-avatar { background: #111115; border: 1px solid rgba(225,225,235,.18); }
.profile-avatar img { display: block; }

/* Shared width constraints: prevent long IDs, JSON, and nested views from stretching the page. */
#app-shell, .main-shell, .view-content, #view, .grid, .panel, .table-panel,
.page-heading, .toolbar, .config-tree, .config-group, .config-field,
.config-field-control, .image-card, .form-field { min-width: 0; max-width: 100%; }
#view img { max-width: 100%; }
.page-heading { flex-wrap: wrap; }
.page-heading > :first-child { min-width: 0; }
.heading-actions { min-width: 0; flex-wrap: wrap; }
.toolbar { width: 100%; min-width: 0; }
.toolbar .input { min-width: 0; flex: 1 1 200px; }
.toolbar select { min-width: 0; max-width: 100%; flex: 0 1 220px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.data-table { max-width: 100%; }
.data-table th, .data-table td { overflow-wrap: anywhere; }
.config-field-control > *, .config-field-title, .setting-line strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.config-field-control textarea { width: 100%; }
.profile-hero { min-width: 0; flex-wrap: wrap; }
.profile-hero > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.image-card input[type="file"] { max-width: 100%; }
.pagination { flex-wrap: wrap; }
.pagination-actions { flex-wrap: wrap; }
.modal-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.modal-card { width: min(440px, 100%); max-height: min(88vh, 760px); max-height: min(88dvh, 760px); overflow-y: auto; }

/* Tablet and mobile layouts. The sidebar becomes a drawer, while content remains fluid. */
@media (max-width: 1000px) {
  .main-shell { width: calc(100% - 220px); }
  .sidebar { width: 220px; }
}

@media (max-width: 760px) {
  html, body { width: 100%; overflow-x: hidden; }
  body.sidebar-open { overflow: hidden; }
  .mobile-only { display: grid; }
  .sidebar {
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(292px, 86vw);
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
    box-shadow: 18px 0 60px rgba(0,0,0,.62);
  }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(3px);
  }
  .main-shell { width: 100%; max-width: 100vw; min-width: 0; margin-left: 0; }
  .topbar {
    position: sticky;
    height: calc(66px + env(safe-area-inset-top));
    min-height: 66px;
    padding: env(safe-area-inset-top) clamp(12px, 3.8vw, 18px) 0;
    gap: 8px;
  }
  .topbar-left { min-width: 0; flex: 1; gap: 10px; }
  .topbar-left > div:last-child { min-width: 0; }
  .topbar-kicker { font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
  .topbar-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { flex: 0 0 auto; gap: 8px; }
  .connection-pill { font-size: 9px; gap: 6px; white-space: nowrap; }
  .topbar-divider { display: none; }
  .owner-chip { gap: 0; }
  .owner-chip > span { display: none; }
  .view-content { width: 100%; max-width: 100%; padding: 20px clamp(12px, 3.8vw, 18px) 28px; }
  .app-footer {
    padding: 0 clamp(12px, 3.8vw, 18px) calc(14px + env(safe-area-inset-bottom));
    gap: 8px;
    flex-wrap: wrap;
  }
  .page-heading { flex-direction: column; align-items: stretch; gap: 11px; margin-bottom: 17px; }
  .page-heading h1 { font-size: 20px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1 1 140px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .stat-card { min-height: 98px; padding: 13px; }
  .stat-value { font-size: clamp(20px, 6vw, 24px); overflow-wrap: anywhere; }
  .content-grid, .settings-grid { grid-template-columns: minmax(0,1fr); }
  .server-grid { grid-template-columns: minmax(0,1fr); }
  .detail-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .config-list, .image-settings { grid-template-columns: minmax(0,1fr); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .config-field { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .audit-item { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .audit-target { text-align: left; }
  .panel { padding: 15px; }
  .panel-header { align-items: flex-start; flex-wrap: wrap; }
  .toolbar { align-items: stretch; }
  .toolbar .input, .toolbar select { flex: 1 1 100%; width: 100%; max-width: none; }
  .toolbar > .button { flex: 1 1 140px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .button { flex: 1 1 140px; }
  .detail-hero { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  .detail-hero > .pill { margin-left: auto; }
  .server-card { min-width: 0; }
  .server-card-meta { max-width: 42%; text-align: right; }
  .metric-row { align-items: flex-start; }
  .metric-row span:first-child { min-width: 0; }
  .metric-row strong { text-align: right; overflow-wrap: anywhere; }
  .setting-line { gap: 10px; }
  .setting-line strong { max-width: 62%; }
  .pagination { align-items: flex-start; }
  .pagination-actions { width: 100%; }
  .pagination-actions .button { flex: 1 1 0; }
  .login-screen { padding: 18px; }
  .login-card { width: min(440px, 100%); padding: 30px 22px 24px; }
  .toast-region { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 24px)); }
}

@media (max-width: 430px) {
  .topbar-right .connection-pill span:last-child { display: none; }
  .topbar-right .owner-chip { display: none; }
  .topbar-left { gap: 8px; }
  .topbar-kicker { font-size: 7px; letter-spacing: .1em; }
  .topbar-title { font-size: 14px; }
  .view-content { padding-left: 11px; padding-right: 11px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 11px; }
  .stat-top { font-size: 10px; }
  .stat-foot { line-height: 1.45; }
  .panel { padding: 13px; }
  .server-card { gap: 9px; padding: 11px; }
  .server-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .server-card-meta { max-width: 40%; }
  .server-card-meta .pill { font-size: 8px; padding: 4px 6px; }
  .data-table { min-width: 560px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

@media (max-width: 350px) {
  .stat-grid, .detail-stats { grid-template-columns: minmax(0,1fr); }
  .connection-pill { display: none; }
  .page-heading h1 { font-size: 19px; }
}

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