:root {
  --bg: #efe7d6;
  --paper: rgba(251, 247, 240, 0.86);
  --paper-strong: #f7f1e6;
  --ink: #1f3142;
  --muted: #5f6d75;
  --line: rgba(31, 49, 66, 0.14);
  --accent: #b36d3f;
  --accent-strong: #91552b;
  --accent-soft: rgba(179, 109, 63, 0.15);
  --shadow: 0 20px 50px rgba(33, 46, 57, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", "Roboto Mono", "Menlo", monospace;
}

:root[data-theme="dark"] {
  --bg: #0d131b;
  --paper: rgba(15, 22, 31, 0.88);
  --paper-strong: #121b25;
  --ink: #f1ead9;
  --muted: #9fb0ba;
  --line: rgba(241, 234, 217, 0.12);
  --accent: #d28a58;
  --accent-strong: #efb07e;
  --accent-soft: rgba(210, 138, 88, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(179, 109, 63, 0.18), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(31, 49, 66, 0.14), transparent 24%),
    linear-gradient(180deg, #f6f0e4 0%, #ece0cb 100%);
}

html[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(210, 138, 88, 0.14), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(83, 109, 138, 0.18), transparent 26%),
    linear-gradient(180deg, #111923 0%, #091018 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 39px, rgba(31, 49, 66, 0.03) 40px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
}

html[data-theme="dark"] body {
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 39px, rgba(241, 234, 217, 0.025) 40px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(31, 49, 66, 0.04) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  opacity: 0.35;
}

html[data-theme="dark"] body::before {
  background-image:
    radial-gradient(rgba(241, 234, 217, 0.06) 0.7px, transparent 0.7px);
  opacity: 0.16;
}

::selection {
  background: rgba(179, 109, 63, 0.22);
  color: var(--ink);
}

html[data-theme="dark"] ::selection {
  background: rgba(210, 138, 88, 0.28);
  color: #f8f1e2;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.lead {
  margin: 0;
  max-width: 56ch;
  line-height: 1.65;
  color: var(--muted);
}

.login-shell,
.dashboard-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.login-panel {
  width: min(540px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.4)), var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise-in 0.7s ease both;
}

.login-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.login-panel h1,
.hero h1 {
  margin: 12px 0 16px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.96;
  text-wrap: balance;
}

.login-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  line-height: 0.98;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(31, 49, 66, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 49, 66, 0.06);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
}

.theme-toggle:focus-visible {
  outline: none;
  border-color: rgba(145, 85, 43, 0.42);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
}

.theme-toggle .theme-icon {
  width: 18px;
  height: 18px;
}

.theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-icon--moon {
  display: none;
}

html[data-theme="dark"] .theme-icon--sun {
  display: block;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.login-form label,
.search-field {
  display: grid;
  gap: 8px;
}

.login-form span,
.search-field span {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.login-form input,
.search-field input {
  width: 100%;
  border: 1px solid rgba(31, 49, 66, 0.16);
  border-radius: 999px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus,
.search-field input:focus {
  border-color: rgba(145, 85, 43, 0.48);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
  transform: translateY(-1px);
}

.login-form button,
.hero-actions button,
.project-links button,
.credential-row button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--ink);
  color: #f8f2e7;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-form button:hover,
.hero-actions button:hover,
.project-links button:hover,
.credential-row button:hover {
  transform: translateY(-1px);
  background: #182632;
  box-shadow: 0 10px 20px rgba(24, 38, 50, 0.18);
}

.form-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(175, 56, 40, 0.1);
  color: #7c291f;
}

.dashboard-shell {
  width: min(1560px, calc(100vw - 40px));
  padding: 24px 0 48px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(320px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)), var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.toolbar-filters,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.toolbar-filters {
  flex-wrap: nowrap;
}

.toolbar-search {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.toolbar-actions {
  justify-content: flex-end;
}

.search-shell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(31, 49, 66, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(31, 49, 66, 0.04);
}

.search-shell {
  width: min(100%, 540px);
  padding: 0 16px;
}

.tag-picker-button svg,
.search-shell svg,
.view-button svg,
.icon-button svg,
.logout-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.search-shell input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search-shell input {
  padding: 13px 0;
}

.search-shell:focus-within {
  border-color: rgba(145, 85, 43, 0.42);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.1);
}

.tag-picker {
  position: relative;
  z-index: 30;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
}

.tag-picker-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(31, 49, 66, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(31, 49, 66, 0.04);
  backdrop-filter: blur(12px);
}

.tag-picker-shell:focus-within {
  border-color: rgba(145, 85, 43, 0.34);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.08);
}

.tag-picker-button,
.tag-pill,
.tag-menu-item,
.tag-menu-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.tag-picker-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(244, 239, 232, 0.96);
  color: var(--muted);
  border: 1px solid rgba(31, 49, 66, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tag-picker-button:hover,
.tag-pill:hover,
.tag-menu-item:hover,
.tag-menu-clear:hover {
  transform: translateY(-1px);
}

.tag-picker-button[aria-expanded="true"] {
  border-color: rgba(145, 85, 43, 0.34);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.08);
}

.tag-picker-button .tag-picker-chevron {
  transition: transform 180ms ease;
}

.tag-picker-button[aria-expanded="true"] .tag-picker-chevron {
  transform: rotate(180deg);
}

.tag-pill-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.tag-pill-list::-webkit-scrollbar {
  display: none;
}

.tag-pill {
  flex: 0 0 auto;
  padding: 0 12px;
  min-height: 38px;
  background: rgba(179, 109, 63, 0.14);
  color: var(--accent-strong);
  border: 1px solid rgba(179, 109, 63, 0.18);
}

.tag-pill-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 1rem;
  line-height: 1;
  transform: rotate(45deg);
}

.tag-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: min(100%, 360px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)), var(--paper-strong);
  box-shadow: 0 24px 60px rgba(21, 31, 40, 0.16);
  backdrop-filter: blur(16px);
}

.tag-menu-item,
.tag-menu-clear {
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  background: rgba(31, 49, 66, 0.06);
  color: var(--ink);
}

.tag-menu-clear {
  background: rgba(179, 109, 63, 0.1);
  color: var(--accent-strong);
}

.tag-menu-count {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 49, 66, 0.08);
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}

.tag-menu-empty {
  margin: 0;
  padding: 6px 4px 2px;
  color: var(--muted);
}

.results-count {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.view-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.view-button,
.logout-button,
.icon-button,
.editor-launch,
.dialog-meta button,
.dialog-credential-actions button,
.editor-delete,
.editor-cancel,
.editor-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 49, 66, 0.08);
  color: var(--ink);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.view-button,
.icon-button {
  width: 40px;
  height: 40px;
}

.view-button.is-active {
  background: var(--ink);
  color: #f8f2e7;
  box-shadow: 0 10px 22px rgba(24, 38, 50, 0.18);
}

.view-button:hover,
.icon-button:hover,
.editor-launch:hover,
.dialog-meta button:hover,
.dialog-credential-actions button:hover,
.editor-delete:hover,
.editor-cancel:hover,
.editor-save:hover {
  transform: translateY(-1px);
  background: rgba(31, 49, 66, 0.14);
}

.editor-launch {
  min-height: 40px;
  padding: 0 14px;
}

.toolbar-logout {
  flex: 0 0 auto;
  align-self: center;
}

.logout-button {
  height: auto;
  min-height: 56px;
  padding: 0 20px;
}

.logout-button--danger {
  background: rgba(154, 53, 48, 0.12);
  color: #8f312d;
}

.logout-button--danger:hover {
  transform: translateY(-1px);
  background: rgba(154, 53, 48, 0.18);
  box-shadow: 0 12px 26px rgba(143, 49, 45, 0.12);
}

.project-collection {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  min-height: 340px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(31, 49, 66, 0.12);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.16);
  animation: rise-in 0.55s ease both;
}

.project-card:nth-child(2) { animation-delay: 70ms; }
.project-card:nth-child(3) { animation-delay: 120ms; }
.project-card:nth-child(4) { animation-delay: 170ms; }
.project-card:nth-child(5) { animation-delay: 220ms; }
.project-card:nth-child(6) { animation-delay: 270ms; }

.project-surface {
  position: relative;
  min-height: 340px;
  height: 100%;
  background: linear-gradient(135deg, rgba(31, 49, 66, 0.12), rgba(179, 109, 63, 0.08));
  outline: none;
  cursor: pointer;
}

.project-surface::before,
.project-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: opacity 220ms ease, transform 280ms ease;
}

.project-surface::before {
  background:
    linear-gradient(180deg, rgba(9, 15, 22, 0.56) 0%, rgba(9, 15, 22, 0.2) 22%, rgba(9, 15, 22, 0.34) 52%, rgba(9, 15, 22, 0.92) 100%);
  z-index: 1;
}

.project-surface::after {
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(180deg, rgba(179, 109, 63, 0.08), transparent 55%);
  z-index: 2;
  opacity: 0.75;
}

.project-surface img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 320ms ease, filter 320ms ease;
}

.project-card:hover .project-surface img,
.project-surface:focus-visible img {
  transform: scale(1.05);
  filter: saturate(1.06) contrast(1.02);
}

.project-card:hover .project-surface::after,
.project-surface:focus-visible::after {
  opacity: 1;
}

.project-surface:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(244, 233, 216, 0.82);
}

.project-overlay {
  position: relative;
  z-index: 3;
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 14px 14px;
  padding: 16px;
  color: #fbf8f3;
}

.project-kicker {
  margin: 0;
  max-width: 100%;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: rgba(251, 248, 243, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-main {
  align-self: end;
  max-width: 28ch;
}

.project-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 2vw, 2.35rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.project-description,
.dialog-description,
.credential-note,
.search-empty,
.empty-state p {
  margin: 0;
  line-height: 1.55;
}

.project-description {
  margin-top: 8px;
  font-size: 0.95rem;
  color: rgba(251, 248, 243, 0.86);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  justify-content: space-evenly;
  gap: 0;
  height: 100%;
  padding: 8px;
  border-radius: 999px;
  background: rgba(8, 13, 20, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 36px rgba(7, 12, 18, 0.22);
  backdrop-filter: blur(14px);
}

.project-actions .icon-button {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: rgba(7, 12, 18, 0.54);
  color: #fbf8f3;
  border: 1px solid rgba(255, 255, 255, 0.24);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.project-actions .icon-button:hover {
  background: rgba(7, 12, 18, 0.76);
  color: #fff;
}

.project-collection[data-view-mode="list"] {
  grid-template-columns: 1fr;
  gap: 12px;
}

.project-collection[data-view-mode="list"] .project-card {
  min-height: 112px;
  border-radius: 22px;
}

.project-collection[data-view-mode="list"] .project-surface,
.project-collection[data-view-mode="list"] .project-overlay {
  min-height: 112px;
}

.project-collection[data-view-mode="list"] .project-surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)), var(--paper);
}

.project-collection[data-view-mode="list"] .project-surface::before,
.project-collection[data-view-mode="list"] .project-surface::after,
.project-collection[data-view-mode="list"] .project-surface img {
  display: none;
}

.project-collection[data-view-mode="list"] .project-overlay {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 14px;
  padding: 16px 18px;
  color: var(--ink);
}

.project-collection[data-view-mode="list"] .project-kicker {
  color: var(--muted);
}

.project-collection[data-view-mode="list"] .project-main {
  align-self: start;
  max-width: 78ch;
}

.project-collection[data-view-mode="list"] .project-name {
  font-size: 1.8rem;
  text-shadow: none;
}

.project-collection[data-view-mode="list"] .project-description {
  color: var(--muted);
  -webkit-line-clamp: 2;
}

.project-collection[data-view-mode="list"] .project-actions {
  grid-row: 1 / span 2;
  flex-direction: row;
  align-self: center;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  gap: 10px;
  justify-content: flex-start;
}

.project-collection[data-view-mode="list"] .project-actions .icon-button {
  background: rgba(31, 49, 66, 0.08);
  color: var(--ink);
  border-color: rgba(31, 49, 66, 0.08);
}

.project-dialog {
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
  box-shadow: none;
}

.project-dialog::backdrop {
  background: rgba(18, 26, 35, 0.58);
  backdrop-filter: blur(12px);
}

.dialog-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.95fr);
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66)), var(--paper-strong);
  box-shadow: var(--shadow);
}

.dialog-media {
  min-height: 520px;
  background:
    radial-gradient(circle at top right, rgba(179, 109, 63, 0.22), transparent 24%),
    linear-gradient(160deg, #172531, #0f1720);
}

.dialog-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dialog-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  max-height: calc(100vh - 32px);
  padding: 24px;
  overflow: auto;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-kicker {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.dialog-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 3.2vw, 3rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.dialog-description,
.credential-note,
.empty-state p {
  color: var(--muted);
}

.dialog-description {
  margin-top: 10px;
}

.dialog-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dialog-meta a,
.dialog-meta button,
.dialog-credential-actions button {
  padding: 10px 14px;
  text-decoration: none;
}

.dialog-meta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 49, 66, 0.08);
  color: var(--ink);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.tag-list li {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialog-credentials {
  display: grid;
  gap: 12px;
  margin: 0;
}

.dialog-credential-row {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(31, 49, 66, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.dialog-credential-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-credential-row dt {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialog-credential-row dd {
  margin: 0;
}

.credential-value {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
}

.credential-value.is-masked {
  letter-spacing: 0.16em;
}

.dialog-credential-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dialog-close {
  flex: 0 0 auto;
}

.project-editor {
  width: min(760px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
  box-shadow: none;
}

.project-editor::backdrop {
  background: rgba(18, 26, 35, 0.58);
  backdrop-filter: blur(12px);
}

.project-editor-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)), var(--paper-strong);
  box-shadow: var(--shadow);
}

.project-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-editor-kicker {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.project-editor-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.project-editor-form,
.project-editor-grid,
.project-editor-field {
  display: grid;
  gap: 14px;
}

.project-editor-form {
  gap: 16px;
}

.project-editor-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(31, 49, 66, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.16);
}

.project-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.project-editor-section-title,
.project-editor-section-copy {
  margin: 0;
}

.project-editor-section-title {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.project-editor-section-copy {
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}

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

.project-editor-grid label {
  display: grid;
  gap: 8px;
}

.project-editor-grid > label > span,
.project-editor-field > span,
.project-editor-derived > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.project-editor-grid input,
.project-editor-grid textarea,
.project-editor-grid select {
  width: 100%;
  border: 1px solid rgba(31, 49, 66, 0.16);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.project-editor-grid input:focus,
.project-editor-grid textarea:focus,
.project-editor-grid select:focus {
  border-color: rgba(145, 85, 43, 0.48);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
  transform: translateY(-1px);
}

.project-editor-field--wide {
  grid-column: 1 / -1;
}

.project-editor-select {
  position: relative;
}

.project-editor-select::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.project-editor-select select {
  appearance: none;
  padding-right: 44px;
}

.project-editor-derived {
  display: grid;
  gap: 8px;
  align-content: start;
}

.project-id-preview {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  border-radius: 18px;
  background: rgba(31, 49, 66, 0.05);
  font-family: var(--mono);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.project-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.project-media-preview {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  background:
    radial-gradient(circle at top right, rgba(179, 109, 63, 0.18), transparent 24%),
    linear-gradient(160deg, rgba(31, 49, 66, 0.14), rgba(31, 49, 66, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.project-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.project-media-actions {
  display: grid;
  gap: 12px;
  align-content: start;
}

.project-upload-zone {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 170px;
  padding: 18px;
  border: 1px dashed rgba(179, 109, 63, 0.34);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(179, 109, 63, 0.08), rgba(179, 109, 63, 0.03)),
    rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.project-upload-zone:hover,
.project-upload-zone.is-active {
  transform: translateY(-1px);
  border-color: rgba(145, 85, 43, 0.48);
  background:
    linear-gradient(180deg, rgba(179, 109, 63, 0.14), rgba(179, 109, 63, 0.05)),
    rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
}

.project-upload-zone:focus-visible {
  outline: none;
  border-color: rgba(145, 85, 43, 0.48);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
}

.project-upload-title,
.project-upload-copy,
.project-upload-meta p {
  margin: 0;
}

.project-upload-title {
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.project-upload-copy {
  color: var(--muted);
  line-height: 1.55;
}

.project-upload-meta {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(31, 49, 66, 0.08);
  background: rgba(31, 49, 66, 0.04);
  color: var(--muted);
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 49, 66, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  cursor: text;
}

.tag-editor:focus-within {
  border-color: rgba(145, 85, 43, 0.48);
  box-shadow: 0 0 0 4px rgba(179, 109, 63, 0.12);
  transform: translateY(-1px);
}

.tag-editor-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill--editor {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(179, 109, 63, 0.14);
  color: var(--accent-strong);
  border: 1px solid rgba(179, 109, 63, 0.18);
  animation: tag-pop 180ms ease;
}

.tag-pill--editor .tag-pill-close {
  font-size: 0.94rem;
}

.tag-editor input {
  flex: 1 1 150px;
  min-width: 150px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  color: var(--ink);
  transform: none !important;
}

.tag-editor input:focus {
  outline: none;
}

.project-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-editor-actions-main {
  display: flex;
  gap: 10px;
}

.editor-delete,
.editor-cancel,
.editor-save {
  min-height: 44px;
  padding: 0 16px;
}

.editor-delete {
  background: rgba(154, 53, 48, 0.1);
  color: #8f312d;
}

.editor-delete:hover {
  background: rgba(154, 53, 48, 0.16);
  box-shadow: 0 12px 26px rgba(143, 49, 45, 0.12);
}

.editor-save {
  background: var(--ink);
  color: #f8f2e7;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.36)), var(--paper-strong);
  box-shadow: var(--shadow);
}

.empty-state h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 0.98;
}

.search-empty {
  margin-top: 14px;
  padding: 8px 4px 0;
  font-weight: 600;
  color: var(--muted);
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(24, 38, 50, 0.92);
  color: #f8f2e7;
  box-shadow: var(--shadow);
  z-index: 5;
}

html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .empty-state {
  background: linear-gradient(180deg, rgba(14, 22, 31, 0.92), rgba(10, 16, 24, 0.78)), var(--paper);
  border-color: rgba(241, 234, 217, 0.08);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .dialog-shell {
  background: linear-gradient(180deg, rgba(14, 22, 31, 0.96), rgba(10, 16, 24, 0.88)), var(--paper-strong);
  border-color: rgba(241, 234, 217, 0.08);
  box-shadow: 0 32px 74px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .project-editor-shell {
  background: linear-gradient(180deg, rgba(14, 22, 31, 0.96), rgba(10, 16, 24, 0.9)), var(--paper-strong);
  border-color: rgba(241, 234, 217, 0.08);
  box-shadow: 0 32px 74px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .project-editor-section {
  background:
    linear-gradient(180deg, rgba(241, 234, 217, 0.02), rgba(241, 234, 217, 0.01)),
    rgba(241, 234, 217, 0.02);
  border-color: rgba(241, 234, 217, 0.08);
}

html[data-theme="dark"] .tag-picker-shell,
html[data-theme="dark"] .search-shell,
html[data-theme="dark"] .view-toggle {
  background: rgba(13, 20, 29, 0.82);
  border-color: rgba(241, 234, 217, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .tag-picker-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .view-button,
html[data-theme="dark"] .editor-launch,
html[data-theme="dark"] .dialog-meta a,
html[data-theme="dark"] .dialog-meta button,
html[data-theme="dark"] .dialog-credential-actions button,
html[data-theme="dark"] .editor-delete,
html[data-theme="dark"] .editor-cancel {
  background: rgba(241, 234, 217, 0.06);
  color: var(--ink);
  border-color: rgba(241, 234, 217, 0.1);
  box-shadow: none;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .tag-picker-button:hover,
html[data-theme="dark"] .view-button:hover,
html[data-theme="dark"] .editor-launch:hover,
html[data-theme="dark"] .dialog-meta a:hover,
html[data-theme="dark"] .dialog-meta button:hover,
html[data-theme="dark"] .dialog-credential-actions button:hover,
html[data-theme="dark"] .editor-delete:hover,
html[data-theme="dark"] .editor-cancel:hover {
  background: rgba(241, 234, 217, 0.1);
}

html[data-theme="dark"] .view-button.is-active {
  background: #2a3d4f;
  color: #f8f1e2;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .logout-button--danger {
  background: rgba(172, 75, 65, 0.18);
  color: #ffb4ac;
}

html[data-theme="dark"] .logout-button--danger:hover {
  background: rgba(172, 75, 65, 0.28);
  box-shadow: 0 14px 28px rgba(88, 19, 13, 0.22);
}

html[data-theme="dark"] .login-form input {
  background: rgba(241, 234, 217, 0.04);
  border-color: rgba(241, 234, 217, 0.12);
  color: var(--ink);
}

html[data-theme="dark"] .login-form input:focus,
html[data-theme="dark"] .search-shell:focus-within,
html[data-theme="dark"] .tag-picker-shell:focus-within {
  border-color: rgba(210, 138, 88, 0.42);
  box-shadow: 0 0 0 4px rgba(210, 138, 88, 0.12);
}

html[data-theme="dark"] .login-form button {
  background: #2a3d4f;
  color: #f8f1e2;
}

html[data-theme="dark"] .login-form button:hover {
  background: #344d63;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .editor-save {
  background: #2a3d4f;
  color: #f8f1e2;
}

html[data-theme="dark"] .editor-save:hover {
  background: #344d63;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .form-error {
  background: rgba(175, 56, 40, 0.18);
  color: #ffb7ae;
}

html[data-theme="dark"] .tag-pill {
  background: rgba(210, 138, 88, 0.18);
  color: #f7c294;
  border-color: rgba(210, 138, 88, 0.28);
}

html[data-theme="dark"] .tag-menu {
  background: linear-gradient(180deg, rgba(14, 22, 31, 0.98), rgba(10, 16, 24, 0.94)), var(--paper-strong);
  border-color: rgba(241, 234, 217, 0.08);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .tag-menu-item {
  background: rgba(241, 234, 217, 0.05);
  color: var(--ink);
}

html[data-theme="dark"] .tag-menu-clear {
  background: rgba(210, 138, 88, 0.14);
  color: #f7c294;
}

html[data-theme="dark"] .tag-menu-count {
  background: rgba(241, 234, 217, 0.08);
  color: var(--muted);
}

html[data-theme="dark"] .project-collection[data-view-mode="list"] .project-surface {
  background: linear-gradient(180deg, rgba(14, 22, 31, 0.92), rgba(10, 16, 24, 0.82)), var(--paper);
}

html[data-theme="dark"] .project-collection[data-view-mode="list"] .project-actions .icon-button {
  background: rgba(241, 234, 217, 0.06);
  color: var(--ink);
  border-color: rgba(241, 234, 217, 0.1);
}

html[data-theme="dark"] .dialog-media {
  background:
    radial-gradient(circle at top right, rgba(210, 138, 88, 0.2), transparent 24%),
    linear-gradient(160deg, #101922, #070d14);
}

html[data-theme="dark"] .dialog-title,
html[data-theme="dark"] .project-editor-title {
  color: #f8f1e2;
}

html[data-theme="dark"] .project-editor-section-title,
html[data-theme="dark"] .project-upload-title {
  color: #f8f1e2;
}

html[data-theme="dark"] .dialog-credential-row {
  background: rgba(241, 234, 217, 0.04);
  border-color: rgba(241, 234, 217, 0.08);
}

html[data-theme="dark"] .project-editor-grid input,
html[data-theme="dark"] .project-editor-grid textarea,
html[data-theme="dark"] .project-editor-grid select {
  background: rgba(241, 234, 217, 0.04);
  border-color: rgba(241, 234, 217, 0.12);
  color: var(--ink);
}

html[data-theme="dark"] .project-editor-grid input:focus,
html[data-theme="dark"] .project-editor-grid textarea:focus,
html[data-theme="dark"] .project-editor-grid select:focus {
  border-color: rgba(210, 138, 88, 0.42);
  box-shadow: 0 0 0 4px rgba(210, 138, 88, 0.12);
}

html[data-theme="dark"] .project-id-preview,
html[data-theme="dark"] .project-upload-meta {
  background: rgba(241, 234, 217, 0.04);
  border-color: rgba(241, 234, 217, 0.08);
}

html[data-theme="dark"] .project-media-preview {
  border-color: rgba(241, 234, 217, 0.08);
  background:
    radial-gradient(circle at top right, rgba(210, 138, 88, 0.18), transparent 24%),
    linear-gradient(160deg, rgba(241, 234, 217, 0.05), rgba(241, 234, 217, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .project-upload-zone {
  background:
    linear-gradient(180deg, rgba(210, 138, 88, 0.12), rgba(210, 138, 88, 0.04)),
    rgba(241, 234, 217, 0.02);
  border-color: rgba(210, 138, 88, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .project-upload-zone:hover,
html[data-theme="dark"] .project-upload-zone.is-active,
html[data-theme="dark"] .project-upload-zone:focus-visible {
  background:
    linear-gradient(180deg, rgba(210, 138, 88, 0.18), rgba(210, 138, 88, 0.06)),
    rgba(241, 234, 217, 0.03);
  box-shadow: 0 0 0 4px rgba(210, 138, 88, 0.12);
}

html[data-theme="dark"] .tag-editor {
  background: rgba(241, 234, 217, 0.04);
  border-color: rgba(241, 234, 217, 0.12);
}

html[data-theme="dark"] .tag-editor:focus-within {
  border-color: rgba(210, 138, 88, 0.42);
  box-shadow: 0 0 0 4px rgba(210, 138, 88, 0.12);
}

html[data-theme="dark"] .tag-pill--editor {
  background: rgba(210, 138, 88, 0.18);
  color: #fff1e2;
  border-color: rgba(210, 138, 88, 0.28);
}

html[data-theme="dark"] .editor-delete {
  background: rgba(172, 75, 65, 0.18);
  color: #ffb4ac;
}

html[data-theme="dark"] .editor-delete:hover {
  background: rgba(172, 75, 65, 0.28);
  box-shadow: 0 14px 28px rgba(88, 19, 13, 0.22);
}

html[data-theme="dark"] .dialog-title::selection,
html[data-theme="dark"] .project-editor-title::selection {
  color: #f8f1e2;
}

html[data-theme="dark"] .copy-toast {
  background: rgba(8, 13, 20, 0.96);
  color: #f8f1e2;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(159, 176, 186, 0.82);
}

[hidden] {
  display: none !important;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tag-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1380px) {
  .project-collection {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .dashboard-topbar {
    flex-direction: column;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-filters,
  .toolbar-actions {
    justify-content: flex-start;
  }

  .toolbar-search {
    justify-content: stretch;
  }

  .search-shell {
    width: 100%;
  }

  .toolbar-logout {
    align-self: flex-end;
  }

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

  .dialog-shell {
    grid-template-columns: 1fr;
  }

  .dialog-media {
    min-height: 360px;
  }

  .dialog-panel {
    max-height: none;
  }

  .project-editor-grid {
    grid-template-columns: 1fr;
  }

  .project-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-shell,
  .dashboard-shell {
    width: min(100vw - 20px, 1560px);
  }

  .toolbar {
    padding: 14px;
  }

  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: space-between;
  }

  .project-collection {
    grid-template-columns: 1fr;
  }

  .project-collection[data-view-mode="list"] .project-overlay {
    grid-template-columns: 1fr;
  }

  .project-collection[data-view-mode="list"] .project-actions {
    grid-row: auto;
    justify-self: start;
    margin-top: 8px;
  }

  .dialog-credential-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .dialog-shell,
  .project-editor-shell,
  .empty-state {
    border-radius: 24px;
  }

  .dialog-panel {
    padding: 20px;
  }

  .project-editor-shell {
    padding: 20px;
  }

  .project-editor-section-head {
    flex-direction: column;
  }

  .project-editor-section-copy {
    text-align: left;
  }

  .project-editor-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .project-editor-actions-main {
    flex-direction: column-reverse;
  }
}
