:root {
  color-scheme: light;
  --bg: #f5f5f8;
  --panel: #fff;
  --ink: #272638;
  --muted: #636575;
  --border: #dddde6;
  --accent: #5945bc;
  --soft: #eeebfa;
  --nav: #211e33;
  --navText: #e6e3f1;
  font:
    16px/1.5 'Segoe UI',
    Inter,
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #171722;
  --panel: #222232;
  --ink: #efedf8;
  --muted: #b1aec1;
  --border: #403e52;
  --accent: #b7a9ff;
  --soft: #36304b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.btn {
  cursor: pointer;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.52rem 0.85rem;
  font-weight: 600;
}
button:hover,
.btn:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9c83fa;
  outline-offset: 2px;
}
.primary {
  background: #5d46be;
  color: white;
  border-color: transparent;
}
.primary:hover {
  background: #503bac;
}
.subtle,
.link {
  background: transparent;
  border-color: transparent;
}
.link {
  color: var(--accent);
  padding-left: 0;
}
.danger {
  color: #b73647;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.22rem;
  letter-spacing: -0.05em;
  font-weight: 750;
  color: white;
}
.brand b {
  font-weight: 400;
}
.brandmark {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, #d6caff, #a58bf5);
  clip-path: polygon(0 0, 70% 0, 100% 30%, 62% 68%, 97% 100%, 46% 100%, 13% 67%, 51% 30%, 0 30%);
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin: 0 0 0.7em;
}
h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}
h2 {
  font-size: 1.45rem;
}
h3 {
  font-size: 1.05rem;
}
a {
  color: var(--accent);
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.entry {
  display: grid;
  grid-template-columns: minmax(350px, 1.05fr) minmax(380px, 1fr);
  min-height: 100dvh;
}
.entry-art,
.hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  background-color: #24203e;
  background-image:
    linear-gradient(125deg, #211c35a6, #39305211), linear-gradient(#938bb81a 1px, transparent 1px),
    linear-gradient(90deg, #938bb81a 1px, transparent 1px);
  background-size:
    auto,
    36px 36px,
    36px 36px;
  color: #fff;
}
.entry-art {
  padding: 3rem clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
}
.entry-title {
  z-index: 1;
}
.entry-title .eyebrow,
.hero .eyebrow {
  color: #d1c1ff;
}
.entry-title h1 {
  font:
    normal clamp(2.6rem, 5vw, 5rem) / 1.03 Georgia,
    serif;
  letter-spacing: -0.05em;
}
.entry-title p {
  color: #d9d4e7;
}
.art-stage {
  position: absolute;
  inset: 12% 0 32%;
  perspective: 1100px;
  pointer-events: none;
}
.stack {
  position: absolute;
  top: 36%;
  left: 26%;
  width: 43%;
  height: 44%;
  min-height: 54px;
  transform: rotateX(55deg) rotateZ(-35deg);
  border-radius: 12px;
  border: 1px solid #ddd1ff;
  box-shadow: -9px 15px 0 #19132933;
}
.stack-a {
  background: #6d58c6;
  translate: 0 34%;
}
.stack-b {
  background: repeating-linear-gradient(90deg, #a68beb 0 8px, #bca9f4 8px 9px);
  translate: 0 7%;
}
.stack-c {
  background: linear-gradient(140deg, #e2d9ff, #c3afe9);
  translate: 0 -23%;
  padding: 8% 9% 3% 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stack i {
  background: #74629d;
  border-radius: 3px;
}
.stack i:first-child {
  grid-column: 1/-1;
}
.entry-form {
  align-self: center;
  width: min(100%, 580px);
  margin: auto;
  padding: clamp(2rem, 5vw, 5rem);
}
.entry-form h2 {
  font-size: 2.25rem;
}
.entry-form > p {
  color: var(--muted);
  margin-bottom: 1.8rem;
}
.gridform,
.dialogbody,
.vstack {
  display: grid;
  gap: 1rem;
}
.pair,
.cards,
.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.gridform label,
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.89rem;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.59rem 0.7rem;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  font-weight: 400;
  min-width: 0;
}
input[type='checkbox'] {
  width: auto;
}
textarea {
  resize: vertical;
}
details {
  margin: 0.4rem 0;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  background: var(--nav);
  color: var(--navText);
  padding: 26px 16px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
  overflow: auto;
}
.sidebar .brand {
  margin: 0 8px 38px;
}
.navgroup {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 16px 12px 7px;
  color: #b0a7c8;
  font-weight: 700;
}
.navbtn {
  border: 0;
  background: transparent;
  color: #d4cfdf;
  display: flex;
  gap: 0.8rem;
  text-align: left;
  align-items: center;
  padding: 0.7rem 0.8rem;
  font-size: 0.93rem;
  font-weight: 500;
}
.navbtn.active,
.navbtn:hover {
  background: #433954;
  color: white;
}
.navbtn.active {
  box-shadow: inset 3px 0 #bda4ff;
}
.sidefoot {
  margin-top: auto;
  border-top: 1px solid #494255;
  padding: 0.9rem 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ded3f4;
  color: #513a67;
  font-weight: 700;
}
.sidefoot small {
  display: block;
  color: #c7c0d5;
}
.topbar {
  height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 3.5vw, 48px);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  gap: 12px;
}
.topbar span {
  font-size: 0.88rem;
}
.topbar strong {
  font-weight: 600;
}
.toolbar,
.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar > * {
  width: auto;
}
.right {
  margin-left: auto;
}
.mobilemenu {
  display: none;
}
.work {
  padding: clamp(20px, 3.5vw, 52px);
  max-width: 1610px;
  margin: auto;
}
.work > header {
  margin-bottom: 1.65rem;
}
.work > header p {
  color: var(--muted);
}
.hero {
  border-radius: 16px;
  padding: clamp(22px, 3.5vw, 44px);
  margin-bottom: 1.6rem;
  min-height: 230px;
  display: flex;
  align-items: center;
}
.hero .art-stage {
  left: 56%;
  right: 0;
  top: -18%;
  bottom: -14%;
}
.hero h2 {
  font:
    normal clamp(2rem, 3.3vw, 3.55rem) / 1.06 Georgia,
    serif;
  max-width: 16ch;
}
.hero p {
  color: #e1dbe9;
  max-width: 40ch;
}
.hero .primary {
  background: #ece4ff;
  color: #332546;
}
.sectiontitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.8rem 0 0.85rem;
}
.sectiontitle h2 {
  margin: 0;
}
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}
.card {
  display: flex;
  gap: 1rem;
  align-items: center;
  text-align: left;
  min-width: 0;
}
.card h3,
.card p {
  margin: 0;
}
.card p,
.card small {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
}
.tileicon {
  background: var(--soft);
  color: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.card:nth-child(2n) .tileicon {
  background: #e0eee7;
  color: #276b53;
}
.empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  color: var(--muted);
}
.list {
  display: grid;
  gap: 0.6rem;
}
.quota-pill {
  background: var(--soft);
  color: var(--accent);
  border: 0;
  border-radius: 100px;
  font-size: 0.82rem;
}
.tag {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--soft);
  color: var(--accent);
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}
.big {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
dialog {
  max-width: min(760px, 94vw);
  max-height: 90dvh;
  width: max-content;
  min-width: min(420px, 92vw);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 80px #1b16364d;
}
dialog::backdrop {
  background: #120f26a8;
}
.dialoghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.dialoghead h2 {
  margin: 0;
}
.dialogbody {
  padding: 20px 24px;
  overflow: auto;
}
.dialogbody pre,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  max-height: 52vh;
  overflow: auto;
}
.scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.86rem;
}
td,
th {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
}
th {
  color: var(--muted);
}
.skip {
  position: absolute;
  left: -10000px;
}
.skip:focus {
  left: 1em;
  top: 1em;
  z-index: 10;
  background: white;
  padding: 1em;
}
#toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  max-width: min(92vw, 520px);
  border-radius: 9px;
  background: #282439;
  color: white;
  z-index: 99;
  padding: 12px 18px;
  display: none;
}
#toast.visible {
  display: block;
}
#toast.error {
  background: #782b41;
}
.chatlayout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1rem;
}
.messages {
  display: grid;
  gap: 1rem;
  max-height: 60vh;
  overflow: auto;
  padding: 0.5rem;
}
.message {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  overflow-wrap: anywhere;
  min-width: 0;
}
.message.user {
  background: var(--soft);
}
.message pre {
  background: #252539;
  color: #eee;
}
.message .toolbar button {
  font-size: 0.78rem;
}
.message img {
  max-width: 100%;
}
.editorgrid {
  display: grid;
  grid-template-columns: var(--left, 180px) minmax(210px, 1fr) var(--right, 220px);
  gap: 10px;
}
.editorgrid .panel {
  padding: 0.75rem;
  min-width: 0;
  overflow: auto;
}
.editorgrid .list button {
  text-align: left;
  overflow-wrap: anywhere;
}
.canvas {
  background: repeating-linear-gradient(45deg, #9090a00e 0 6px, transparent 6px 12px);
  overflow: auto;
  text-align: center;
  min-height: 360px;
}
.canvas iframe {
  border: 0;
  background: white;
  width: 100%;
  min-height: 420px;
  height: 55vh;
}
.editorcode {
  height: 48vh;
  min-height: 240px;
}
.edbar {
  margin: 0.7rem 0;
}
.entry-form small,
.dialogbody small {
  font-weight: 400;
}
.mobiletabs {
  display: none;
}
.art-card {
  height: 90px;
  background: linear-gradient(145deg, var(--soft), var(--panel));
  color: var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
}
.art-card iframe {
  pointer-events: none;
  width: 350%;
  height: 320px;
  transform: scale(0.28);
  border: none;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.media-grid img {
  max-width: 100%;
  height: 115px;
  object-fit: contain;
}
.danger-zone {
  border-color: #b95c6b;
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.wide {
  grid-column: 1/-1;
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.tabactive {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--accent);
}
.thumb {
  width: 96px;
  height: 64px;
  overflow: hidden;
  border-radius: 5px;
  flex: none;
  background: var(--soft);
}
.thumb iframe {
  transform-origin: top left;
  width: 600px;
  height: 400px;
  transform: scale(0.16);
  border: 0;
  pointer-events: none;
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .editorgrid {
    grid-template-columns: 155px minmax(180px, 1fr) 180px;
  }
  .work {
    padding: 24px;
  }
}
@media (max-width: 900px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    max-width: 280px;
    width: 80%;
    box-shadow: 0 0 0 100vmax #17142566;
  }
  .sidebar.open {
    display: flex;
  }
  .mobilemenu {
    display: inline-block;
  }
  .mobiletabs {
    display: flex;
  }
  .editorgrid {
    display: block;
  }
  .editorgrid > [data-pane] {
    display: none;
  }
  .editorgrid > [data-pane].current {
    display: block;
  }
  .entry-art {
    padding: 2rem;
  }
  .chatlayout {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  .entry {
    display: block;
  }
  .entry-art {
    min-height: 150px;
    padding: 1.5rem;
  }
  .entry-title {
    display: none;
  }
  .entry-art .art-stage {
    inset: -35% 0 -25% 42%;
  }
  .entry-form {
    padding: 2rem 1.3rem;
  }
  .work {
    padding: 18px 14px;
  }
  .pair,
  .columns,
  .cards,
  .chatlayout {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 210px;
    padding: 22px;
  }
  .hero .art-stage {
    left: 64%;
    opacity: 0.48;
  }
  .hero h2 {
    font-size: 2.1rem;
  }
  .hero p {
    max-width: 25ch;
  }
  .chatlist {
    max-height: 160px;
    overflow: auto;
  }
  .topbar {
    height: 56px;
  }
  .topbar .crumb {
    display: none;
  }
  .checks {
    grid-template-columns: 1fr;
  }
  .editorgrid iframe {
    min-height: 340px;
  }
  .dialoghead,
  .dialogbody {
    padding: 15px;
  }
  .toolbar {
    gap: 0.35rem;
  }
  .toolbar button {
    font-size: 0.85rem;
  }
  .sectiontitle {
    margin-top: 1.3rem;
  }
  .sidefoot {
    margin-top: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.12s,
      border-color 0.12s;
  }
  .hero .stack,
  .entry-art .stack {
    animation: rise 0.6s ease-out;
  }
  @keyframes rise {
    from {
      opacity: 0.2;
      transform: translateY(12px) rotateX(55deg) rotateZ(-35deg);
    }
  }
}
