:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #10251f;
  background: #edf2ee;
  font-synthesis: none;
  --ink: #10251f;
  --deep: #102822;
  --muted: #4b625a;
  --line: #d4e0d8;
  --accent: #c2edc5;
  --accent-hover: #a9e4af;
  --white: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { border: 1px solid transparent; border-radius: 9px; font-weight: 650; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #299870; outline-offset: 3px;
}
a { color: inherit; }
.primary, .secondary { min-height: 43px; padding: 9px 16px; }
.primary { background: var(--accent); color: #10291e; }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--ink); background: var(--white); border-color: var(--line); }
.secondary:hover { background: #eaf5ee; }
input:not([type="checkbox"]), select, textarea {
  color: var(--ink); background: #fff; width: 100%; min-width: 0; min-height: 44px;
  border: 1px solid #bbcfc3; border-radius: 8px; padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: #5e736b; }
textarea { resize: vertical; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 650; }
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  padding: clamp(25px, 7vw, 110px); gap: clamp(35px, 7vw, 120px);
  background: radial-gradient(ellipse at 12% 88%, #285345 0%, transparent 53%), #10251f;
}
.login-identity { color: white; }
.login-identity img { width: min(200px, 78%); filter: brightness(0) invert(1); }
.login-identity p { font-size: clamp(3rem, 8.2vw, 8rem); font-weight: 760; letter-spacing: -.082em; line-height: 1.08; }
.login-identity span { color: var(--accent); }
.login-card {
  padding: clamp(22px, 4vw, 49px); border-radius: 18px; background: #f7faf7;
  justify-self: end; max-width: 490px; width: 100%;
}
.login-card h1, .public-card h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.055em; }
.login-card > p { color: var(--muted); margin: 8px 0 25px; }
.login-card form { display: grid; gap: 16px; }
.error { color: #9d2c32; font-size: .88rem; }
.dashboard { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  padding: 32px 18px 22px; background: var(--deep); color: #f3faf6; position: sticky;
  top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 42px;
}
.brand { padding-left: 12px; }
.brand img { width: 101px; display: block; filter: brightness(0) invert(1); }
.brand p { font-size: 1.65rem; font-weight: 700; line-height: 1.14; letter-spacing: -.055em; margin-top: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; background: #29473d; color: #e9fff0;
  border-radius: 8px; padding: 13px 12px; text-decoration: none; font-size: .92rem; font-weight: 650;
}
.qr-icon {
  width: 19px; height: 19px; flex: 0 0 19px; border-radius: 2px;
  background:
    linear-gradient(currentColor 0 0) top left / 7px 7px,
    linear-gradient(currentColor 0 0) top right / 7px 7px,
    linear-gradient(currentColor 0 0) bottom left / 7px 7px,
    linear-gradient(currentColor 0 0) bottom right / 4px 4px,
    linear-gradient(currentColor 0 0) 12px 12px / 3px 3px;
  background-repeat: no-repeat;
}
.account { display: flex; align-items: center; gap: 8px; margin-top: auto; min-width: 0; }
.account div { display: grid; flex: 1; min-width: 0; font-size: .85rem; }
.account strong { overflow: hidden; text-overflow: ellipsis; }
.account small { color: #c0d7cf; }
.avatar {
  width: 35px; height: 35px; border-radius: 8px; display: grid; place-items: center;
  background: #31564a; color: #e1ffed; font-weight: 700;
}
.logout { background: transparent; color: #dcf4e8; padding: 8px 5px; font-size: .83rem; }
.logout:hover { background: #31564a; }
.workspace { padding: clamp(18px, 3.8vw, 56px); width: 100%; max-width: 1560px; margin-inline: auto; }
.hero {
  border-radius: 16px; padding: clamp(22px, 4vw, 46px); color: #f7fff9; display: flex;
  align-items: flex-end; justify-content: space-between; gap: 24px;
  background: radial-gradient(ellipse at 92% 100%, #34745d 0%, transparent 63%), #15372b;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 4.4rem); letter-spacing: -.075em; line-height: 1.05; }
.hero p { color: #d5eade; margin-top: 13px; }
.hero .primary { flex: 0 0 auto; }
.hero .primary span { font-size: 1.15em; margin-right: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 20px 0 27px; }
.stats > div { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: #f9fcfa; }
.stats span { display: block; color: var(--muted); font-weight: 650; font-size: .82rem; }
.stats strong { display: block; font-size: 2rem; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.collection { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.collection-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 19px; }
.collection-head h2 { letter-spacing: -.045em; font-size: 1.38rem; }
.filters { display: flex; gap: 8px; }
.filters select { width: auto; flex: 0 0 auto; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead { color: #39544a; background: #f4f8f5; font-size: .77rem; text-align: left; }
thead th { font-weight: 700; }
thead th:first-child { width: 29%; }
thead th:nth-child(2) { width: 15%; }
thead th:nth-child(4) { width: 14%; }
thead th:last-child { width: 153px; }
td, th { padding: 12px; overflow-wrap: anywhere; }
td:first-child, th:first-child { padding-left: 19px; }
tbody th { text-align: left; font-size: .88rem; }
tbody tr + tr { border-top: 1px solid #edf1ee; }
tbody td { font-size: .82rem; color: #39544a; }
.item-icon {
  display: inline-grid; width: 36px; height: 36px; place-items: center;
  vertical-align: middle; margin-right: 7px; background: #e9f3ed; color: #245742; border-radius: 8px;
}
.pill, .state { display: inline-block; font-weight: 650; }
.pill { border-radius: 20px; padding: 5px 8px; background: #e4f2e8; color: #1a5540; }
.pill.static { background: #edf0ed; color: #3a4d44; }
.state { color: #42584e; }
.state.paused { color: #885329; }
.content-cell { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { white-space: nowrap; min-height: 38px; padding: 5px 9px; }
.empty { text-align: center; padding: 42px 20px 50px; background: #f9fcfa; color: var(--muted); }
.empty strong { display: block; font-size: 1.1rem; color: var(--ink); margin-bottom: 5px; }
.retry { display: block; margin: 0 auto 20px; }
dialog {
  padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 15px;
  width: min(530px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
}
dialog::backdrop { background: #10251fc2; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 23px; }
.dialog-header h2 { font-size: 1.45rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.close { font-size: 1.6rem; width: 38px; height: 38px; flex-shrink: 0; background: #eaf2ed; color: var(--ink); }
#editor-form, .preview-body { display: grid; gap: 13px; padding: 0 23px 23px; }
.hint { color: var(--muted); font-size: .85rem; }
.hint:empty { display: none; }
.checkbox { display: flex; align-items: center; gap: 6px; }
.checkbox input { width: 18px; height: 18px; accent-color: #285b49; }
.dialog-actions, .download-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions { justify-content: flex-end; margin-top: 6px; }
.preview-body { justify-items: center; text-align: center; }
.download-actions { justify-content: center; }
.qr-frame { width: min(248px, 100%); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.qr-frame img { display: block; width: 100%; height: 100%; }
#qr-value { color: var(--muted); max-height: 80px; width: 100%; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .86rem; }
#open-qr { color: #1a644a; font-weight: 650; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); white-space: normal; max-width: calc(100% - 24px); padding: 12px 16px; border-radius: 8px; color: #fff; background: #193e30; z-index: 2; }
.public-page { display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 12% 88%, #285345 0%, transparent 56%), #10251f; }
.public-card { width: min(100%, 640px); padding: clamp(23px, 5vw, 52px); color: var(--ink); background: #f8fbf8; border-radius: 14px; overflow-wrap: anywhere; }
.public-card img { width: 122px; margin-bottom: 23px; filter: brightness(0) saturate(100%); }
.public-card .message { white-space: pre-wrap; line-height: 1.6; margin-top: 14px; }
@media (max-width: 1100px) {
  .dashboard { grid-template-columns: 185px minmax(0, 1fr); }
  .workspace { padding: 24px; }
  .sidebar { padding-inline: 11px; }
}
@media (max-width: 850px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; }
  .sidebar nav { display: none; }
  .account { margin-top: 0; }
  .brand { padding: 0; }
  .brand img { width: 77px; }
  .brand p { font-size: 1.15rem; margin-top: 4px; }
}
@media (max-width: 640px) {
  .login { grid-template-columns: 1fr; gap: 27px; align-content: center; justify-items: center; }
  .login-card { justify-self: center; }
  .login-identity img { width: 106px; }
  .login-identity p { font-size: 3.5rem; }
  .workspace { padding: 15px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 16px; }
  .hero p { margin-top: 7px; }
  .stats { gap: 6px; margin: 12px 0 15px; }
  .stats > div { padding: 9px; }
  .stats span { min-height: 2.4em; }
  .stats strong { font-size: 1.6rem; }
  .filters { width: 100%; }
  .filters select { max-width: 45%; }
  table, tbody, tr, tbody th, td { display: block; }
  thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  tbody tr { padding: 12px 18px; display: grid; gap: 6px; }
  tbody td, tbody th { padding: 0 !important; }
  tbody td[data-label]::before { content: attr(data-label) " · "; margin-right: 3px; }
  .content-cell { display: inline; white-space: normal; overflow-wrap: anywhere; }
  .row-actions { margin-top: 6px; }
}
