:root {
  --bg: #0c1210;
  --bg-elevated: #121a17;
  --bg-card: #151e1b;
  --ink: #e8f0eb;
  --muted: #9aada3;
  --line: rgba(232, 240, 235, 0.12);
  --accent: #d4a24c;
  --accent-soft: rgba(212, 162, 76, 0.16);
  --accent-ink: #1a1408;
  --danger: #d45c5c;
  --teal: #3d8f7a;
  --ok: #3d8f7a;
  --radius: 4px;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --space: clamp(1rem, 3vw, 1.75rem);
  --sidebar: 280px;
  --bar-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink);
  background: #0a100e;
  padding-bottom: calc(var(--bar-h) + 1.5rem);
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  z-index: 80;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--space);
  background: rgba(12, 18, 16, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 162, 76, 0.16);
  box-shadow: 0 1px 0 rgba(61, 143, 122, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f3d18a 0%, var(--accent) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(212, 162, 76, 0.35));
}

.aura {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 85% -8%, rgba(61, 143, 122, 0.34), transparent 58%),
    radial-gradient(ellipse 55% 42% at -8% 92%, rgba(212, 162, 76, 0.24), transparent 52%),
    linear-gradient(165deg, #0a100e 0%, #101916 48%, #0c1210 100%);
}

.aura::before {
  content: "";
  position: absolute;
  width: 36rem;
  height: 36rem;
  right: -8rem;
  top: 18%;
  background: radial-gradient(circle, rgba(61, 143, 122, 0.2), transparent 68%);
  animation: orbFloat 22s ease-in-out infinite;
}

.aura::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 240, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 240, 235, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 10%, black, transparent 78%);
  animation: gridDrift 28s linear infinite;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 64px 64px, 64px 64px; }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6%, 8%) scale(1.08); }
}

.brand-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: calc(100vh - 68px);
}

.sidebar {
  border-right: 1px solid rgba(232, 240, 235, 0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(18, 26, 23, 0.58);
  backdrop-filter: blur(18px);
  min-height: 0;
}

.brief-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.brief-list li {
  margin: 0;
}

.brief-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  color: var(--ink);
}

.brief-item:hover,
.brief-item:focus-visible {
  background: rgba(212, 162, 76, 0.08);
  border-color: var(--line);
}

.brief-item.is-active {
  background: rgba(212, 162, 76, 0.16);
  border-color: var(--accent);
}

.brief-item strong {
  display: block;
  font-size: 0.92rem;
}

.brief-item span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.brief-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}

.sidebar-foot {
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.main {
  padding: var(--space);
  max-width: 880px;
}

.notice,
.banner {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(61, 143, 122, 0.28);
  background:
    linear-gradient(165deg, rgba(61, 143, 122, 0.14), transparent 55%),
    rgba(21, 30, 27, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.notice strong {
  color: var(--ink);
}

.banner {
  background: rgba(212, 92, 92, 0.12);
  border-color: var(--danger);
  color: var(--ink);
}

.card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(212, 162, 76, 0.09), transparent 46%),
    rgba(21, 30, 27, 0.78);
  border: 1px solid rgba(232, 240, 235, 0.1);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:focus-within {
  border-color: rgba(212, 162, 76, 0.45);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(212, 162, 76, 0.12),
    0 0 36px rgba(61, 143, 122, 0.1);
}

.card-head {
  margin-bottom: 1rem;
}

.card-head h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.field > span,
.checks legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

abbr {
  color: var(--accent);
  text-decoration: none;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: linear-gradient(180deg, rgba(232, 240, 235, 0.04), transparent 42%), #0e1513;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.25);
}

.search {
  background: #0e1513;
}

.color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-row input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.checks {
  border: 1px dashed rgba(61, 143, 122, 0.4);
  border-radius: 8px;
  background: rgba(61, 143, 122, 0.05);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-size: 0.92rem;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.preview {
  margin-top: 0.5rem;
  min-height: 0;
}

.preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.file-preview-item {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.file-download {
  font-size: 0.75rem;
  color: var(--gold, #d4a24c);
  text-decoration: underline;
}

.file-missing {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #c45c5c;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

.btn i {
  font-size: 1.05em;
  line-height: 1;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
  pointer-events: none;
}

.btn.full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(212, 162, 76, 0.32);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 12px 28px rgba(212, 162, 76, 0.42);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost i {
  color: var(--accent);
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(212, 92, 92, 0.4);
}

.btn-danger:hover,
.btn-danger:focus-visible {
  border-color: var(--danger);
  background: rgba(212, 92, 92, 0.12);
  color: #f0c4c4;
}

.btn-danger i {
  color: inherit;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  gap: 0.45rem;
}

.btn-icon {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.sticky-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--bar-h);
  padding: 0.6rem var(--space);
  background: rgba(12, 18, 16, 0.82);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(212, 162, 76, 0.2);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.35);
}

.save-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.save-state.is-ok {
  color: var(--teal);
  text-shadow: 0 0 14px rgba(61, 143, 122, 0.5);
}

.bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bar-h) + 0.75rem);
  z-index: 50;
  background: var(--ink);
  color: var(--bg);
  padding: 0.65rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-on {
  opacity: 1;
  transform: none;
}

.tabs {
  position: sticky;
  top: 68px;
  z-index: 20;
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.45rem 0 0.65rem;
  background: linear-gradient(180deg, rgba(10, 16, 14, 0.78), rgba(10, 16, 14, 0.35));
  backdrop-filter: blur(10px);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(18, 26, 23, 0.65);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  min-height: 44px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tab:hover,
.tab:focus-visible {
  border-color: var(--accent);
  color: var(--ink);
}

.tab.is-on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(212, 162, 76, 0.28);
}

.panel-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.notice-client {
  display: none;
}

.notice code {
  color: var(--accent);
  font-size: 0.88em;
}

body.is-client-mode .sidebar,
body.is-client-mode .tabs,
body.is-client-mode #btn-toggle-list,
body.is-client-mode .notice-dev,
body.is-client-mode #btn-export,
body.is-client-mode #btn-delete,
body.is-client-mode .panel-kicker {
  display: none;
}

body.is-client-mode .notice-client {
  display: block;
}

body.is-client-mode .layout {
  grid-template-columns: 1fr;
}

.brand-client {
  display: none;
}

body.is-client-mode .brand-admin {
  display: none;
}

body.is-client-mode .brand-client {
  display: block;
}

.brand-client[hidden],
.brand-admin[hidden] {
  display: none !important;
}

.logo {
  text-decoration: none;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 25;
    max-height: calc(100dvh - 14rem);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar.is-open {
    display: flex;
  }

  .grid,
  .service-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  body {
    padding-bottom: 11rem;
  }

  .sticky-bar {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  .bar-actions {
    justify-content: stretch;
  }

  .bar-actions .btn {
    flex: 1;
  }
}

@media (min-width: 861px) {
  #btn-toggle-list {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .tab,
  .toast,
  .card {
    transition: none;
  }

  .btn:hover,
  .btn:focus-visible {
    transform: none;
  }

  .aura::before,
  .aura::after {
    animation: none;
  }
}
