:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #67736d;
  --line: #d9e1dc;
  --paper: #f8f5ef;
  --surface: #ffffff;
  --accent: #7b5842;
  --accent-strong: #4f3425;
  --warn: #9b3d2e;
  --sun: #c9964f;
  --sky: #d9e5e0;
  --rose: #ead2ca;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #edf2ee;
  color: var(--ink);
  border: 1px solid var(--line);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(31, 24, 19, 0.62), rgba(31, 24, 19, 0.18)),
    url("/assets/salon-interior.png") center / cover;
}

.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 18px;
  box-shadow: 0 18px 60px rgba(31, 24, 19, 0.22);
}

.login-panel h1,
.sidebar h1,
.list-header h2 {
  margin: 0;
}

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

.error {
  min-height: 20px;
  margin: 0;
  color: var(--warn);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  background: #fffaf3;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.user-badge {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4f7f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tab {
  background: #edf2ee;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--accent);
  color: white;
}

.notice {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-left: 4px solid var(--sun);
  background: #fff7e8;
  border-radius: var(--radius);
  color: #473518;
}

.notice span {
  font-size: 13px;
  line-height: 1.6;
}

.workspace {
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1160px;
}

.panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.photo-panel,
.treatment-panel {
  grid-column: span 1;
}

.panel {
  display: grid;
  gap: 14px;
}

.form-actions {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.panel-heading span {
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}

.check-row input,
.chip-grid input {
  width: auto;
  margin-top: 3px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.chip-grid label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  color: var(--ink);
  background: #f5f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.treatment-grid label {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid #dfd0c4;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffdf9, #f6eee6);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.treatment-grid input {
  width: auto;
  accent-color: var(--accent);
}

.treatment-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.photo-preview {
  min-height: 220px;
  border: 1px dashed #b9c6bf;
  border-radius: var(--radius);
  background: #f5f7f4;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 20px;
}

.result-panel {
  max-width: 1160px;
  margin-top: 18px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.image-set {
  display: grid;
  gap: 10px;
}

.image-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #eef3f0;
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.effect-hair-color img {
  filter: sepia(0.24) saturate(1.45) hue-rotate(-14deg) brightness(1.05);
}

.effect-hair-color::before {
  background: linear-gradient(135deg, rgba(143, 79, 45, 0.26), rgba(255, 238, 204, 0.08));
}

.effect-cut img {
  filter: contrast(1.08) brightness(1.03);
}

.effect-cut::before {
  background: radial-gradient(circle at 50% 34%, transparent 0 32%, rgba(255, 250, 243, 0.18) 48%, transparent 64%);
}

.effect-brow img {
  filter: contrast(1.14) saturate(1.08);
}

.effect-brow::before {
  background: linear-gradient(180deg, rgba(68, 43, 31, 0.18), transparent 30%);
}

.effect-makeup img {
  filter: saturate(1.28) brightness(1.06);
}

.effect-makeup::before {
  background: radial-gradient(circle at 50% 44%, rgba(218, 120, 128, 0.20), transparent 42%);
}

.effect-lash img {
  filter: contrast(1.2) saturate(1.05);
}

.effect-lash::before {
  background: linear-gradient(180deg, rgba(32, 24, 20, 0.20), transparent 24%);
}

.effect-facial img {
  filter: brightness(1.1) saturate(0.92);
}

.effect-facial::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(217, 229, 224, 0.16));
}

.effect-proposal-board {
  aspect-ratio: 16 / 9;
  background: #101315;
}

.effect-proposal-board img {
  object-fit: contain;
}

.image-card::after {
  content: attr(data-label);
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  z-index: 2;
}

.memo {
  white-space: pre-wrap;
  line-height: 1.8;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.status-panel,
.regenerate-form,
.set-history,
.set-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf3;
}

.status-panel {
  margin: 12px 0;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-strong);
}

.status-panel span {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.regenerate-form {
  margin: 12px 0;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.set-history {
  margin-top: 16px;
  padding: 14px;
}

.set-history h3 {
  margin: 0 0 12px;
}

.set-item {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.set-item + .set-item {
  margin-top: 10px;
}

.set-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.set-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.set-images .image-card {
  max-width: 760px;
}

.list-header {
  max-width: 1160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.consultation-list {
  max-width: 1160px;
  display: grid;
  gap: 10px;
}

.list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.list-item h3 {
  margin: 0 0 6px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .workspace {
    padding: 18px;
  }

  .form-grid,
  .result-layout,
  .two-col,
  .treatment-grid,
  .set-images {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .chip-grid {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .list-item {
    grid-template-columns: 1fr;
    display: grid;
  }
}
