:root {
  color-scheme: light;
  --bg: #fffaf1;
  --bg-soft: #f6ead8;
  --surface: rgba(255, 255, 255, .58);
  --surface-strong: rgba(255, 255, 255, .78);
  --surface-muted: rgba(255, 250, 241, .58);
  --ink: #2b261f;
  --muted: #7c7164;
  --line: rgba(255, 255, 255, .72);
  --brand: #c9944c;
  --brand-strong: #9d6a2e;
  --accent: #f1cf95;
  --gold: #f6c86f;
  --green: #8ab66a;
  --red: #dc2626;
  --red-dark: #991b1b;
  --input: rgba(255, 255, 255, .72);
  --cream-glow: rgba(255, 222, 166, .62);
  --warm-glow: rgba(246, 200, 111, .34);
  --shadow: 0 28px 90px rgba(145, 100, 43, .17);
  --shadow-soft: 0 16px 40px rgba(145, 100, 43, .11);
  --glass: rgba(255, 255, 255, .48);
  --transparent: transparent;
  --page-light-glow: rgba(255, 255, 255, .96);
  --page-end: #fffdf8;
  --tap-highlight: transparent;
  --glass-highlight-92: rgba(255, 255, 255, .92);
  --glass-highlight-88: rgba(255, 255, 255, .88);
  --glass-highlight-86: rgba(255, 255, 255, .86);
  --glass-highlight-84: rgba(255, 255, 255, .84);
  --glass-highlight-82: rgba(255, 255, 255, .82);
  --glass-highlight-78: rgba(255, 255, 255, .78);
  --glass-highlight-72: rgba(255, 255, 255, .72);
  --glass-highlight-68: rgba(255, 255, 255, .68);
  --glass-highlight-58: rgba(255, 255, 255, .58);
  --glass-highlight-48: rgba(255, 255, 255, .48);
  --glass-highlight-44: rgba(255, 255, 255, .44);
  --glass-highlight-40: rgba(255, 255, 255, .40);
  --glass-highlight-38: rgba(255, 255, 255, .38);
  --glass-highlight-36: rgba(255, 255, 255, .36);
  --glass-highlight-34: rgba(255, 255, 255, .34);
  --glass-highlight-24: rgba(255, 250, 241, .24);
  --glass-highlight-22: rgba(255, 248, 233, .22);
  --glass-highlight-20: rgba(255, 255, 255, .20);
  --glass-highlight-18: rgba(255, 252, 246, .18);
  --glass-highlight-16: rgba(255, 216, 140, .16);
  --glass-highlight-08: rgba(255, 255, 255, .08);
  --cream-soft-96: rgba(255, 255, 255, .96);
  --cream-soft-94: rgba(255, 255, 255, .94);
  --cream-soft-84: rgba(255, 255, 255, .84);
  --cream-soft-82: rgba(255, 255, 255, .82);
  --cream-soft-72: rgba(255, 230, 184, .72);
  --cream-soft-62: rgba(255, 241, 212, .62);
  --cream-soft-58: rgba(255, 230, 184, .58);
  --cream-soft-48: rgba(201, 148, 76, .48);
  --cream-soft-46: rgba(255, 233, 190, .46);
  --cream-soft-40: rgba(255, 241, 212, .40);
  --cream-soft-34: rgba(255, 224, 173, .34);
  --cream-soft-18: rgba(255, 216, 140, .18);
  --brown-shadow-34: rgba(63, 42, 18, .34);
  --brown-shadow-22: rgba(169, 104, 31, .22);
  --brown-shadow-20: rgba(145, 100, 43, .20);
  --brown-shadow-16: rgba(172, 117, 47, .16);
  --brown-shadow-09: rgba(172, 117, 47, .09);
  --brown-overlay-58: rgba(58, 39, 18, .54);
  --modal-backdrop: rgba(92, 59, 24, .34);
  --danger-shadow: rgba(220, 38, 38, .22);
  --success-mix-border: color-mix(in srgb, var(--green) 38%, var(--transparent));
  --success-mix-bg: color-mix(in srgb, var(--green) 16%, var(--surface-strong));
  --success-mix-text: color-mix(in srgb, var(--green) 68%, var(--ink));
  --danger-mix-border: color-mix(in srgb, var(--red) 38%, var(--transparent));
  --danger-mix-bg: color-mix(in srgb, var(--red) 12%, var(--surface-strong));
  --danger-dialog-border: color-mix(in srgb, var(--red) 34%, var(--transparent));
  --danger-dialog-bg: color-mix(in srgb, var(--red) 8%, var(--cream-soft-84));
  --muted-placeholder: color-mix(in srgb, var(--muted) 68%, var(--transparent));
  --brand-hover-shadow: color-mix(in srgb, var(--brand) 34%, var(--transparent));
  --primary-start: #fff9ed;
  --primary-mid: #e5b96e;
  --primary-end: #b9792e;
  --primary-text: #3c2811;
  --floating-text: #2f3a20;
  --floating-green-glass: rgba(138, 182, 106, .70);
  --floating-cream-glass: rgba(242, 211, 154, .74);
  --focus-ring: rgba(255, 222, 166, .36);
  --checked-ring: rgba(255, 222, 166, .40);
  --section-rule-highlight: rgba(255, 255, 255, .92);
  --section-rule-shadow: rgba(201, 148, 76, .22);
  --sun-ring-shadow: color-mix(in srgb, var(--gold) 22%, var(--transparent));
  --plain-white: #fff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2b241c;
  --bg-soft: #423426;
  --surface: rgba(255, 250, 241, .12);
  --surface-strong: rgba(255, 250, 241, .16);
  --surface-muted: rgba(255, 239, 213, .10);
  --ink: #fff8ed;
  --muted: #dbcab5;
  --line: rgba(255, 255, 255, .20);
  --brand: #f1c982;
  --brand-strong: #d7a75d;
  --accent: #fff0cc;
  --gold: #ffd88c;
  --green: #b8d58a;
  --red: #ef4444;
  --red-dark: #f87171;
  --input: rgba(255, 250, 241, .11);
  --cream-glow: rgba(255, 217, 146, .30);
  --warm-glow: rgba(255, 244, 219, .16);
  --shadow: 0 30px 90px rgba(0, 0, 0, .34);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, .22);
  --glass: rgba(255, 250, 241, .13);
  --page-light-glow: rgba(255, 250, 241, .20);
  --page-end: #34291f;
  --tap-highlight: transparent;
  --glass-highlight-92: rgba(255, 250, 241, .24);
  --glass-highlight-88: rgba(255, 250, 241, .22);
  --glass-highlight-86: rgba(255, 250, 241, .20);
  --glass-highlight-84: rgba(255, 250, 241, .18);
  --glass-highlight-82: rgba(255, 250, 241, .17);
  --glass-highlight-78: rgba(255, 250, 241, .16);
  --glass-highlight-72: rgba(255, 250, 241, .14);
  --glass-highlight-68: rgba(255, 250, 241, .13);
  --glass-highlight-58: rgba(255, 250, 241, .18);
  --glass-highlight-48: rgba(255, 250, 241, .16);
  --glass-highlight-44: rgba(255, 250, 241, .14);
  --glass-highlight-40: rgba(255, 250, 241, .13);
  --glass-highlight-38: rgba(255, 250, 241, .16);
  --glass-highlight-36: rgba(255, 250, 241, .12);
  --glass-highlight-34: rgba(255, 250, 241, .11);
  --glass-highlight-24: rgba(255, 250, 241, .12);
  --glass-highlight-22: rgba(255, 248, 233, .22);
  --glass-highlight-20: rgba(255, 250, 241, .13);
  --glass-highlight-18: rgba(255, 252, 246, .10);
  --glass-highlight-16: rgba(255, 216, 140, .16);
  --glass-highlight-08: rgba(255, 250, 241, .08);
  --cream-soft-96: rgba(255, 250, 241, .22);
  --cream-soft-94: rgba(255, 250, 241, .20);
  --cream-soft-84: rgba(255, 250, 241, .16);
  --cream-soft-82: rgba(255, 250, 241, .15);
  --cream-soft-72: rgba(255, 230, 184, .18);
  --cream-soft-62: rgba(255, 241, 212, .16);
  --cream-soft-58: rgba(255, 230, 184, .17);
  --cream-soft-48: rgba(201, 148, 76, .22);
  --cream-soft-46: rgba(255, 233, 190, .18);
  --cream-soft-40: rgba(255, 241, 212, .14);
  --cream-soft-34: rgba(255, 224, 173, .18);
  --cream-soft-18: rgba(255, 216, 140, .18);
  --brown-shadow-34: rgba(0, 0, 0, .34);
  --brown-shadow-22: rgba(0, 0, 0, .28);
  --brown-shadow-20: rgba(0, 0, 0, .24);
  --brown-shadow-16: rgba(0, 0, 0, .22);
  --brown-shadow-09: rgba(0, 0, 0, .18);
  --brown-overlay-58: rgba(35, 24, 14, .58);
  --modal-backdrop: rgba(18, 12, 8, .58);
  --primary-start: rgba(255, 248, 233, .24);
  --primary-mid: rgba(241, 201, 130, .42);
  --primary-end: rgba(215, 167, 93, .56);
  --primary-text: var(--ink);
  --floating-text: var(--ink);
  --floating-green-glass: rgba(184, 213, 138, .24);
  --floating-cream-glass: rgba(255, 216, 140, .22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, var(--page-light-glow), var(--transparent) 18rem),
    radial-gradient(circle at 82% 4%, var(--cream-glow), var(--transparent) 29rem),
    radial-gradient(circle at 50% 50%, var(--warm-glow), var(--transparent) 42rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft) 58%, var(--page-end));
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.8;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a,
label {
  -webkit-tap-highlight-color: var(--transparent);
}

.site-shell {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 84px;
}

.topbar,
.admin-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  padding: 10px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-84);
  backdrop-filter: blur(24px) saturate(1.35);
}

.topbar {
  direction: ltr;
}

.topbar-name {
  position: absolute;
  left: 50%;
  max-width: min(52vw, 420px);
  transform: translateX(-50%);
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 10px 28px var(--brown-shadow-16);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-button,
.admin-link,
.outline-button,
.primary-button,
.small-button,
.floating-add,
.upload-button,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}

.phone-button:hover,
.admin-link:hover,
.outline-button:hover,
.small-button:hover,
.upload-button:hover,
.theme-toggle:hover,
.floating-add:hover {
  transform: translateY(-1px);
}

.phone-button {
  width: 48px;
  min-width: 48px;
  border: 1px solid var(--glass-highlight-78);
  background: linear-gradient(135deg, var(--cream-soft-94), var(--cream-soft-62));
  color: var(--ink);
  padding: 0;
  box-shadow: 0 14px 32px var(--brown-shadow-16), inset 0 1px 0 var(--glass-highlight-92);
}

:root[data-theme="dark"] .phone-button {
  color: var(--ink);
  background: linear-gradient(135deg, var(--glass-highlight-22), var(--glass-highlight-16));
}

.phone-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.admin-link,
.outline-button,
.small-button {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--glass-highlight-72), var(--cream-soft-40));
  color: var(--ink);
  padding: 8px 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight-78), 0 12px 28px var(--brown-shadow-09);
}

.primary-button {
  width: 100%;
  border: 1px solid var(--glass-highlight-78);
  background: linear-gradient(135deg, var(--primary-start), var(--primary-mid) 54%, var(--primary-end));
  color: var(--primary-text);
  padding: 13px 18px;
  font-weight: 800;
  box-shadow: 0 18px 42px var(--brown-shadow-22), inset 0 1px 0 var(--glass-highlight-86);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px var(--brand-hover-shadow);
}

.theme-toggle {
  position: relative;
  width: 48px;
  min-width: 48px;
  border: 1px solid var(--line);
  background: var(--glass-highlight-36);
  padding: 0;
  box-shadow: inset 0 1px 0 var(--glass-highlight-72);
}

.theme-toggle::before {
  content: none;
}

.theme-icon {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
}

:root[data-theme="light"] .theme-icon.moon,
:root[data-theme="dark"] .theme-icon.sun {
  display: none;
}

.theme-icon.sun {
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px var(--sun-ring-shadow);
}

.theme-icon.moon {
  border-radius: 50%;
  background: var(--ink);
}

.theme-icon.moon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-muted);
}

.slideshow {
  position: relative;
  height: clamp(420px, 58vw, 660px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-highlight-34);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight-78);
  backdrop-filter: blur(20px) saturate(1.18);
  isolation: isolate;
}

.slideshow::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid var(--glass-highlight-44);
  border-radius: 8px;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .7s ease, transform 1.2s ease;
}

.slide.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
}

.slide img,
.work-card img,
.current-image {
  display: block;
  width: 100%;
  object-fit: cover;
}

.slide img {
  height: 100%;
  opacity: .86;
  filter: saturate(.82) contrast(.88) brightness(1.14);
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 4%, var(--glass-highlight-58), var(--transparent) 24rem),
    radial-gradient(circle at 72% 72%, var(--cream-soft-46), var(--transparent) 26rem),
    linear-gradient(0deg, var(--brown-overlay-58), var(--glass-highlight-24) 64%),
    linear-gradient(90deg, var(--glass-highlight-18), var(--transparent) 56%);
}

.slide-caption {
  position: absolute;
  right: clamp(22px, 5vw, 72px);
  bottom: clamp(36px, 6vw, 82px);
  z-index: 4;
  width: min(650px, calc(100% - 44px));
  color: var(--plain-white);
  text-shadow: 0 12px 34px var(--brown-shadow-34);
}

.slide-caption::before {
  content: "نمونه ویژه";
  display: inline-flex;
  margin-bottom: 14px;
  border: 1px solid var(--glass-highlight-48);
  border-radius: 8px;
  background: var(--glass-highlight-20);
  padding: 5px 10px;
  color: var(--glass-highlight-92);
  font-size: 12px;
  line-height: 1.4;
  backdrop-filter: blur(12px);
}

.slide-caption h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.14;
  letter-spacing: 0;
  text-wrap: balance;
}

.slide-caption p {
  max-width: 620px;
  margin: 0;
  color: var(--glass-highlight-86);
  font-size: clamp(15px, 2vw, 20px);
}

.slide-dots {
  position: absolute;
  bottom: 28px;
  left: 28px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

.slide-dots button {
  width: 28px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--glass-highlight-38);
  cursor: pointer;
  transition: width .22s ease, background .22s ease;
}

.slide-dots button.is-active {
  width: 48px;
  background: var(--plain-white);
}

.about-section,
.panel-section,
.admin-panel,
.editor-form {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 3vw, 34px);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-82);
  backdrop-filter: blur(26px) saturate(1.22);
}

.about-section {
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(var(--accent), var(--glass-highlight-92), var(--brand));
}

.about-section p {
  max-width: 920px;
  margin: 0 auto;
  color: var(--muted);
  text-align: center;
  font-size: clamp(16px, 2vw, 20px);
}

.work-section {
  margin-top: 38px;
}

.work-section h2,
.panel-section h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: 0;
}

.work-section h2::after,
.panel-section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--glass-highlight-92), var(--accent), var(--brand));
  box-shadow: 0 8px 18px var(--section-rule-shadow);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--glass-highlight-36);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.slideshow > .empty-state {
  position: absolute;
  inset: 14px;
  min-height: 0;
  color: var(--glass-highlight-84);
  background: var(--glass-highlight-08);
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-78);
  backdrop-filter: blur(18px) saturate(1.18);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.public-work-card {
  cursor: pointer;
}

.work-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-highlight-92);
  box-shadow: var(--shadow), 0 0 46px var(--cream-soft-34);
}

.work-card img {
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  filter: saturate(.92) brightness(1.04);
  transition: transform .36s ease;
}

.work-card:hover img {
  transform: scale(1.035);
}

.work-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 15px 0 0;
}

.work-card h3 {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: 0;
}

.work-card p {
  display: -webkit-box;
  flex: 1;
  min-height: 78px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.view-work-button {
  align-self: flex-end;
  margin-top: 14px;
  margin-left: 0;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-left: 0;
  border-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 0;
  background: linear-gradient(135deg, var(--glass-highlight-82), var(--cream-soft-58));
  color: var(--ink);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 var(--glass-highlight-78), 0 12px 28px var(--brown-shadow-09);
  transition: transform .2s ease, box-shadow .2s ease;
}

.view-work-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.detail-shell {
  width: min(980px, calc(100% - 36px));
}

.detail-view {
  display: grid;
  gap: 22px;
}

.detail-hero,
.detail-cover,
.detail-media,
.detail-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-82);
  backdrop-filter: blur(26px) saturate(1.22);
}

.detail-hero {
  display: grid;
  gap: 12px;
  padding: clamp(22px, 4vw, 44px);
}

.detail-back {
  width: max-content;
}

.detail-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.18;
  letter-spacing: 0;
}

.detail-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.detail-media {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px);
}

.detail-cover {
  margin: 0;
  overflow: hidden;
  padding: clamp(12px, 2vw, 18px);
}

.detail-cover img {
  display: block;
  width: 100%;
  max-height: 560px;
  border-radius: 8px;
  object-fit: cover;
}

.detail-media img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}

.detail-content {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 44px);
}

.detail-content figure {
  margin: 0;
}

.detail-content img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}

.detail-content h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.3;
  letter-spacing: 0;
}

.detail-content p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.admin-page {
  background:
    radial-gradient(circle at 20% 8%, var(--cream-soft-94), var(--transparent) 18rem),
    radial-gradient(circle at top left, var(--cream-glow), var(--transparent) 31rem),
    radial-gradient(circle at 72% 44%, var(--warm-glow), var(--transparent) 38rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
}

.admin-shell,
.editor-shell {
  padding-bottom: 112px;
}

.admin-header {
  direction: rtl;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.25;
  letter-spacing: 0;
}

.admin-header p {
  margin: 2px 0 0;
  color: var(--muted);
}

.admin-panel {
  display: grid;
  gap: 20px;
  padding: 0;
  border: 0;
  background: var(--transparent);
  box-shadow: none;
  backdrop-filter: none;
}

.notice {
  margin: 16px 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.notice.success {
  border: 1px solid var(--success-mix-border);
  background: var(--success-mix-bg);
  color: var(--success-mix-text);
}

.notice.danger {
  border: 1px solid var(--danger-mix-border);
  background: var(--danger-mix-bg);
  color: var(--red-dark);
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 var(--glass-highlight-72);
  backdrop-filter: blur(14px);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.text-input::placeholder {
  color: var(--muted-placeholder);
}

.text-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus-ring), inset 0 1px 0 var(--glass-highlight-82);
}

.about-editor {
  min-height: 190px;
  resize: vertical;
}

.selectable-card {
  position: relative;
  cursor: pointer;
}

.selectable-card input {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 24px;
  height: 24px;
  accent-color: var(--brand);
}

.selectable-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--checked-ring), var(--shadow-soft);
}

.selectable-card span {
  display: block;
  padding: 13px 13px 0;
  font-weight: 800;
}

.compact-actions {
  padding: 0 13px 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.admin-work-card .card-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.danger-button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--plain-white);
  padding: 8px 12px;
  cursor: pointer;
}

.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px var(--danger-shadow);
}

.floating-add {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 35;
  width: min(440px, calc(100% - 32px));
  transform: translateX(50%);
  border: 1px solid var(--glass-highlight-78);
  background: linear-gradient(135deg, var(--page-light-glow), var(--floating-cream-glass), var(--floating-green-glass));
  color: var(--floating-text);
  padding: 14px 18px;
  font-weight: 900;
  box-shadow: 0 22px 52px var(--brown-shadow-20), inset 0 1px 0 var(--glass-highlight-88);
  backdrop-filter: blur(20px) saturate(1.2);
}

.delete-dialog {
  width: min(470px, calc(100% - 28px));
  border: 1px solid var(--danger-dialog-border);
  border-radius: 8px;
  background: var(--danger-dialog-bg);
  color: var(--ink);
  padding: 24px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight-84);
  backdrop-filter: blur(24px) saturate(1.2);
}

.delete-dialog::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(10px);
}

.delete-dialog h2 {
  margin: 0 0 8px;
  color: var(--red-dark);
}

.delete-dialog p {
  margin: 0;
  color: var(--muted);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.editor-form {
  display: grid;
  gap: 18px;
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.current-image {
  max-height: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-78);
}

.editor-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="work-form"] .editor-shell {
  padding-right: min(210px, 18vw);
}

body[data-page="work-form"] .editor-toolbar {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 40;
  width: 170px;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  padding: 10px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-84);
  backdrop-filter: blur(24px) saturate(1.35);
}

body[data-page="work-form"] .editor-toolbar .upload-button,
body[data-page="work-form"] .editor-toolbar .outline-button {
  width: 100%;
}

.upload-button {
  border: 1px solid var(--glass-highlight-78);
  background: linear-gradient(135deg, var(--cream-soft-94), var(--cream-soft-72), var(--cream-soft-48));
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 800;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight-88);
}

:root[data-theme="dark"] .upload-button {
  color: var(--ink);
  background: linear-gradient(135deg, var(--glass-highlight-22), var(--cream-soft-18));
}

.upload-button input {
  display: none;
}

.content-builder {
  display: grid;
  gap: 14px;
}

.builder-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
  box-shadow: inset 0 1px 0 var(--glass-highlight-68);
  backdrop-filter: blur(16px);
}

.builder-block.is-dragging {
  opacity: .62;
  outline: 2px solid var(--brand);
}

.builder-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}

.drag-handle {
  width: 42px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-highlight-36);
  color: var(--muted);
  cursor: grab;
  letter-spacing: 0;
}

.builder-block:active .drag-handle {
  cursor: grabbing;
}

.builder-image-preview {
  display: block;
  width: 100%;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  object-fit: cover;
}

.block-text {
  min-height: 170px;
  resize: vertical;
}

.remove-block {
  min-height: 42px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 10px;
  }

  .topbar,
  .admin-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .topbar-name {
    position: static;
    max-width: 100%;
    transform: none;
    order: -1;
    padding: 2px 0 4px;
  }

  .phone-button {
    width: 48px;
  }

  .admin-link,
  .outline-button {
    width: 100%;
  }

  .slideshow {
    height: clamp(176px, 45vw, 220px);
  }

  .slide-caption {
    bottom: 54px;
  }

  .slide-caption h1 {
    font-size: clamp(30px, 10vw, 46px);
  }

  .slide-dots {
    left: 22px;
    bottom: 22px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .work-card-body {
    padding: 11px;
  }

  .work-card h3 {
    font-size: 15px;
  }

  .work-card p {
    min-height: 66px;
    font-size: 12.5px;
  }

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

  .editor-toolbar,
  .dialog-actions,
  .card-actions {
    grid-template-columns: 1fr;
  }

  body[data-page="work-form"] .editor-shell {
    padding-right: 0;
    padding-bottom: 210px;
  }

  body[data-page="work-form"] .editor-toolbar {
    width: 150px;
  }
}

body[data-page="work-form"] .editor-toolbar {
  position: fixed !important;
  top: 50% !important;
  right: 16px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1000 !important;
  width: 170px;
  transform: translateY(-50%) !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-auto-flow: row !important;
  gap: 10px !important;
}

@media (max-width: 760px) {
  body[data-page="work-form"] .editor-toolbar {
    right: 10px !important;
    width: 140px;
  }
}
