:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(17, 14, 12, 0.86);
  --paper: #fff6e8;
  --muted: #c9b8a3;
  --line: rgba(255, 246, 232, 0.14);
  --gold: #f0b65b;
  --ember: #e24a2f;
  --teal: #55b6a9;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(rgba(5,5,5,.86), rgba(5,5,5,.92)),
    url("tattoo-bg-ambient-v1.svg") center / cover fixed no-repeat,
    var(--bg);
  color: var(--paper);
  font-family: Inter, system-ui, sans-serif;
}
button, input, textarea, select { font: inherit; }
.shell { display: grid; grid-template-columns: 18rem 1fr; min-height: 100svh; }
.shell.is-auth {
  grid-template-columns: 1fr;
}
.shell.is-auth .sidebar {
  display: none;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: rgba(5,5,5,.76);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: .75rem; align-items: center; color: inherit; text-decoration: none; margin-bottom: 2rem; }
.brand img { width: 3rem; height: 3rem; }
.brand strong, .brand small { display: block; }
.brand small, p, .status, label { color: var(--muted); }
.portal-language {
  display: grid;
  gap: .4rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.portal-language select {
  min-height: 2.6rem;
  border: 1px solid rgba(240, 182, 91, .42);
  border-radius: 8px;
  background: rgba(5,5,5,.72);
  color: var(--paper);
  padding: 0 .75rem;
  cursor: pointer;
}
.auth-language {
  width: min(14rem, 100%);
}
nav { display: grid; gap: .55rem; }
nav button, .logout, .button {
  min-height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,246,232,.06);
  color: var(--paper);
  cursor: pointer;
  font-weight: 900;
}
nav button.is-active { border-color: rgba(240,182,91,.55); color: var(--gold); }
.logout { width: 100%; margin-top: 2rem; }
.auth-panel, .workspace { padding: clamp(1rem, 4vw, 3rem); }
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(20rem, .55fr);
  gap: 2rem;
  align-items: center;
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
}
.auth-panel h1, .workspace-head h1 {
  max-width: 12ch;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.7rem, 6vw, 6rem);
  line-height: 1;
}
.eyebrow {
  color: var(--gold);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
form, .panel {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0,0,0,.45);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,246,232,.045);
}
.auth-tabs button {
  min-height: 2.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}
.auth-tabs button.is-active {
  background: linear-gradient(135deg, var(--gold), #ffd891, var(--ember));
  color: #160d07;
}
form h2 {
  margin: .2rem 0 0;
  font-family: Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}
label { display: grid; gap: .4rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5,5,5,.74);
  color: var(--paper);
  padding: .85rem;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
.auth-actions, .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.auth-actions a { text-decoration: none; }
.button.primary { background: linear-gradient(135deg, var(--gold), #ffd891, var(--ember)); color: #160d07; }
.button.ghost { background: rgba(255,246,232,.08); }
.button.line { color: #d8fff8; border-color: rgba(85,182,169,.4); }
.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.user-chip {
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 900;
  background: rgba(255,246,232,.06);
}
.view { display: none; }
.view.is-active { display: block; }
.catalog-panel {
  margin-bottom: 1rem;
  gap: 1.1rem;
}
.catalog-panel > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}
.catalog-panel h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: .95;
}
.catalog-panel p {
  max-width: 34rem;
  margin: 0;
}
.style-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: .9rem;
}
.style-card {
  position: relative;
  display: grid;
  min-height: 19rem;
  overflow: hidden;
  border: 1px solid rgba(255,246,232,.16);
  border-radius: 8px;
  background: #080706;
  isolation: isolate;
}
.style-card-featured {
  grid-column: span 2;
  min-height: 23rem;
}
.style-card-tall {
  min-height: 28rem;
}
.style-card-wide {
  min-height: 18rem;
}
.style-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,5,5,.88) 0%, rgba(5,5,5,.5) 46%, rgba(5,5,5,.16) 100%),
    var(--style-image) center / cover no-repeat;
  transform: scale(1.02);
  z-index: -1;
}
.style-card:nth-child(even) .style-media {
  background:
    linear-gradient(90deg, rgba(5,5,5,.16) 0%, rgba(5,5,5,.48) 42%, rgba(5,5,5,.9) 100%),
    var(--style-image) center / cover no-repeat;
}
.style-copy {
  display: flex;
  flex-direction: column;
  justify-content: end;
  width: min(100%, 29rem);
  min-height: 100%;
  padding: 1.1rem;
  background: linear-gradient(180deg, transparent, rgba(5,5,5,.42));
}
.style-card:nth-child(even) .style-copy {
  margin-left: auto;
}
.style-copy > span {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .12em;
}
.style-copy h3 {
  margin: .1rem 0 .8rem;
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 3.1vw, 3.6rem);
  line-height: .95;
}
.style-copy dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin: 0 0 .9rem;
}
.style-copy dl div {
  padding: .6rem;
  border: 1px solid rgba(255,246,232,.13);
  border-radius: 8px;
  background: rgba(5,5,5,.58);
  backdrop-filter: blur(10px);
}
.style-copy dt {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.style-copy dd {
  margin: .18rem 0 0;
  color: var(--paper);
  font-weight: 900;
}
.tool-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(20rem, .65fr); gap: 1rem; }
.category-filter {
  display: grid;
  grid-template-columns: minmax(8rem, .75fr) minmax(11rem, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .72rem;
  margin: .2rem 0 .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,246,232,.045);
}
.category-filter span {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.category-filter select { padding: .7rem .78rem; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .85rem; }
.art-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,246,232,.05);
}
.art-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.art-card div { padding: .75rem; }
.art-card strong { display: block; }
.art-category {
  display: inline-flex;
  width: fit-content;
  margin-bottom: .45rem;
  border: 1px solid rgba(240,182,91,.45);
  border-radius: 999px;
  padding: .22rem .5rem;
  color: var(--gold);
  background: rgba(240,182,91,.08);
  font-weight: 900;
}
.quote-box {
  padding: 1rem;
  border-left: 3px solid var(--gold);
  background: rgba(240,182,91,.1);
  color: var(--paper);
  font-weight: 900;
}
.appointments { display: grid; gap: .8rem; }
.appointment {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,246,232,.055);
}
.appointment strong, .appointment span { display: block; }
.ai-result img { width: min(100%, 28rem); border-radius: 8px; border: 1px solid var(--line); }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .shell, .auth-panel, .tool-grid { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .catalog-panel > div:first-child { display: grid; }
  .style-catalog { grid-template-columns: 1fr; }
  .style-card-featured { grid-column: span 1; }
  .style-card, .style-card-wide, .style-card-tall, .style-card-featured { min-height: 23rem; }
  .style-copy, .style-card:nth-child(even) .style-copy { margin-left: 0; }
  .auth-actions, .form-grid, .category-filter { grid-template-columns: 1fr; }
}
