:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #e9eee9;
  background: #101714;
  color-scheme: dark;
  --surface: #19221d;
  --border: #303d34;
  --muted: #a3b4a8;
  --accent: #c5ef9c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid #415147;
  border-radius: 8px;
  padding: 11px 15px;
  background: #243128;
  color: #e9eee9;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}
button:hover {
  border-color: var(--accent);
  background: #304233;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  color: #172313;
  border-color: var(--accent);
}
.primary:hover {
  background: #d8ffb4;
}
.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.danger {
  background: #602e2e;
  border-color: #a25555;
}
.wide {
  width: 100%;
}
.small {
  font-size: 11px;
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.accent {
  color: var(--accent);
}
.eyebrow,
.nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.eyebrow {
  color: var(--accent);
}
.tag {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 1px;
  border: 1px solid #425546;
  padding: 5px 7px;
  border-radius: 5px;
  color: #b2c1b6;
  white-space: nowrap;
}
h1 {
  font-size: clamp(30px, 3vw, 43px);
  line-height: 1.15;
  letter-spacing: -1.7px;
  margin: 12px 0 14px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
  margin: 0 0 20px;
}
p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
  margin: 10px 0 20px;
}
.shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 36px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #121b16;
}
.brand {
  font-size: 31px;
  font-weight: 750;
  letter-spacing: -1.8px;
  text-decoration: none;
  color: #f1f6f0;
  display: block;
}
.brand > span {
  color: var(--accent);
}
.brand small {
  font-size: 9px;
  letter-spacing: 4px;
  display: block;
  color: var(--muted);
  margin-top: 5px;
  margin-left: 2px;
}
.nav-label {
  margin: 52px 12px 18px;
  color: #91a598;
  font-size: 9px;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #acbdb1;
  padding: 13px 12px;
}
nav button > span {
  font-size: 22px;
  width: 25px;
  font-weight: 400;
}
nav button[aria-current="page"] {
  background: #29392b;
  color: #d0f5b0;
  border-color: #3b5039;
}
.count {
  margin-left: auto;
  font-size: 9px;
  background: #3b4a3c;
  border-radius: 4px;
  padding: 3px 5px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 10px 0;
}
.sidebar-bottom .eyebrow {
  font-size: 8px;
}
.sidebar-bottom p {
  font-size: 17px;
  color: #c8d5ca;
  line-height: 1.6;
}
.sidebar-bottom button {
  padding-left: 0;
}
main {
  min-width: 0;
  padding: 0 38px;
  max-width: 1600px;
  width: 100%;
  margin: auto;
}
.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 23px 0 16px;
}
.topbar > span {
  margin-right: auto;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: #7d8b81;
}
.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 4px #c5ef9c15;
}
.segmented {
  display: flex;
  background: #0d130f;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  background: none;
  color: #acbdb1;
  font-size: 11px;
  padding: 8px 12px;
}
.segmented [aria-pressed="true"] {
  background: #334333;
  color: #e7f4df;
}
.connection-hint {
  font-size: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 19px;
  margin: 0 0 38px;
  color: #9bafa1;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
  gap: 30px;
}
.content {
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.page-heading p {
  margin-bottom: 0;
  max-width: 440px;
}
.page-heading > button {
  flex-shrink: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-heading h2 {
  margin: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
  margin-bottom: 20px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.favorite-card,
.image-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 13px;
  overflow: hidden;
  min-width: 0;
}
.favorite-visual {
  height: 120px;
  background: var(--tint, #24332a);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.favorite-visual img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.light-orb {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 42px var(--light);
}
.combo-dot {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--light);
  height: 13px;
  width: 13px;
  border: 2px solid #fff5;
  border-radius: 50%;
}
.card-body {
  padding: 17px;
}
.card-body h3 {
  font-size: 14px;
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}
.card-body p {
  font-size: 10px;
  margin: 0 0 16px;
}
.card-actions {
  display: flex;
  gap: 7px;
  margin-top: 16px;
}
.card-actions > .primary {
  flex: 1;
}
.icon-button {
  background: transparent;
  border-color: transparent;
  font-size: 21px;
  padding: 4px 8px;
  line-height: 1.3;
}
.card-actions .icon-button {
  font-size: 16px;
  padding: 6px;
}
.empty-state {
  padding: 42px 25px;
  text-align: center;
  border: 1px dashed #465d4b;
  border-radius: 14px;
  background: linear-gradient(135deg, #1b281e, #142019);
}
.empty-icon {
  font-size: 44px;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}
.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.empty-state p {
  max-width: 380px;
  margin: 0 auto 24px;
}
.tip {
  display: flex;
  gap: 18px;
  padding: 24px;
  margin-top: 27px;
  background: #1e2b20;
  border: 1px solid #354832;
  border-radius: 12px;
}
.tip > span {
  font-size: 25px;
  color: var(--accent);
}
.tip strong {
  font-size: 12px;
  color: #cde9ba;
}
.tip p {
  font-size: 12px;
  margin: 6px 0 0;
}
.inspector {
  position: sticky;
  top: 24px;
  align-self: start;
  border: 1px solid var(--border);
  background: #151f19;
  border-radius: 16px;
  padding: 22px 18px;
}
.inspector .eyebrow {
  font-size: 8px;
}
.device {
  background: #090e0b;
  border: 2px solid #455349;
  border-radius: 19px;
  width: 162px;
  padding: 10px 10px 8px;
  margin: 26px auto 0;
  box-shadow: 0 16px 28px #0005;
}
.device-screen {
  width: 138px;
  height: 161px;
  border-radius: 8px;
  background: #18291f;
  overflow: hidden;
}
.device-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#previewPlaceholder {
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background: radial-gradient(ellipse at 90% 100%, #40553a, #16291e);
}
#previewPlaceholder > span {
  font-size: 11px;
  font-weight: 750;
}
#previewPlaceholder > span span {
  color: var(--accent);
}
#previewPlaceholder strong {
  font-size: 21px;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: #cceab5;
}
.led-strip {
  height: 4px;
  border-radius: 5px;
  margin: 9px 10px 5px;
  background: #526358;
}
.device-brand {
  display: block;
  text-align: center;
  font-size: 6px;
  color: #a4b7aa;
  letter-spacing: 2px;
}
.inspector-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  padding: 13px 0;
}
.inspector-row > span {
  color: var(--muted);
}
.inspector-row strong {
  text-align: right;
  font-size: 10px;
  font-weight: 500;
  overflow-wrap: anywhere;
  max-width: 140px;
}
.brightness {
  padding: 20px 0 5px;
  border-top: 1px solid var(--border);
}
.brightness label,
.brightness button {
  font-size: 11px;
}
.connection-help {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 20px;
}
.connection-help strong {
  font-size: 11px;
}
.connection-help p {
  font-size: 11px;
  margin: 7px 0 0;
}
.activity-panel {
  margin-top: 28px;
  padding: 18px 22px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}
summary .tag {
  margin-left: 10px;
}
ul {
  padding: 0;
  list-style: none;
  margin: 0;
}
#activity li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
#activity li > span {
  color: var(--muted);
  max-width: 65%;
  overflow-wrap: anywhere;
}
#activity li > strong {
  font-weight: 500;
  text-align: right;
}
#activity .failed {
  color: #f5a6a0;
}
#activity .done {
  color: var(--accent);
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  margin-top: 38px;
  padding: 22px 0;
  color: #a3b4a8;
  font-size: 9px;
  letter-spacing: 1.4px;
}
footer span {
  letter-spacing: 0;
  font-size: 11px;
}
#mobileLogout {
  display: none;
}
.color-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.color-presets button {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 5px 12px;
  text-align: left;
  background: #202d24;
  padding: 18px;
}
.color-presets i {
  grid-row: span 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch);
  align-self: center;
}
.color-presets strong {
  font-size: 13px;
}
.color-presets span {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
label {
  display: block;
  font-size: 12px;
  color: #bbcabf;
  margin: 18px 0 8px;
}
input,
select,
textarea {
  width: 100%;
  display: block;
  background: #101a13;
  border: 1px solid #3a4a3e;
  color: #e9eee9;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
}
input[type="color"] {
  width: 64px;
  height: 44px;
  padding: 4px;
  cursor: pointer;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
  margin: 16px 0 20px;
}
output {
  float: right;
  color: var(--accent);
}
.color-field {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 18px 0;
}
.color-field > div {
  flex: 1;
}
.color-field label {
  margin-top: 0;
}
.color-field input[type="color"] {
  height: 68px;
  width: 85px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.filterbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.search-label {
  margin: 0;
  max-width: 270px;
  flex: 1;
  font-size: 10px;
  color: var(--muted);
}
.search-label input {
  margin-top: 6px;
}
.image-visual {
  height: 190px;
  background: repeating-conic-gradient(#18251d 0% 25%, #1d2c22 0% 50%) 50%/18px
    18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.image-visual img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 12px #0004;
}
.device-files {
  margin-top: 25px;
}
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.inline-form > div {
  flex: 1;
}
#devicePictures {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}
#devicePictures > div {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
#devicePictures span {
  margin-right: auto;
  overflow-wrap: anywhere;
}
#devicePictures button {
  padding: 6px 10px;
  font-size: 10px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.template {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}
.template canvas {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: contain;
  background: #17221b;
  padding: 12px;
}
.template span {
  display: block;
  padding: 14px;
  font-size: 12px;
}
.space-top {
  margin-top: 32px;
}
dialog {
  color: #e9eee9;
  background: #19241d;
  border: 1px solid #485b4b;
  border-radius: 17px;
  padding: 28px;
  width: min(510px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 25px 100px #0008;
}
dialog::backdrop {
  background: #050b08c9;
  backdrop-filter: blur(5px);
}
.large-dialog {
  width: min(780px, calc(100% - 24px));
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}
.dialog-heading h2 {
  font-size: 22px;
  margin: 9px 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
}
.check-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
}
.canvas-preview {
  background: #111b14;
  border-radius: 12px;
  padding: 18px 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}
.editor-layout canvas,
.canvas-preview img {
  width: 216px;
  height: 252px;
  border-radius: 8px;
  object-fit: contain;
  background: #101714;
}
.editor-layout label:first-child {
  margin-top: 0;
}
.dropzone {
  border: 1px dashed #688361;
  border-radius: 12px;
  padding: 24px 15px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #223326;
}
.dropzone strong {
  color: var(--accent);
}
.dropzone small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.dropzone.dragging {
  background: #334b2b;
  border-color: var(--accent);
}
input[type="file"] {
  margin: 10px 0 20px;
  font-size: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid input[type="color"] {
  width: 100%;
}
.warning {
  color: #f2c37c;
}
.login-shell {
  max-width: 560px;
  margin: 70px auto;
  padding: 24px;
}
.login-shell > .brand {
  margin-bottom: 36px;
}
.login-shell .panel {
  padding: 38px;
}
.login-shell button {
  margin-top: 20px;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(650px, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid #729c59;
  background: #d0efb7;
  color: #172313;
  box-shadow: 0 5px 30px #0007;
  border-radius: 10px;
  font-size: 13px;
}
#notice.error {
  background: #482a27;
  border-color: #a15b51;
  color: #ffe0da;
}
#notice button {
  padding: 0 5px;
  font-size: 21px;
  border: 0;
  background: transparent;
  color: inherit;
}
.transfer {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: min(340px, calc(100% - 40px));
  padding: 20px;
  background: #263a29;
  border: 1px solid #729c59;
  border-radius: 12px;
  z-index: 25;
  box-shadow: 0 10px 40px #0006;
}
.transfer > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
}
progress {
  width: 100%;
  height: 7px;
  accent-color: var(--accent);
  margin: 15px 0 7px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
@media (min-width: 1450px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  main {
    padding: 0 25px;
  }
  .sidebar {
    padding: 30px 16px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 215px;
    gap: 20px;
  }
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .inspector {
    padding: 20px 12px;
  }
  .template canvas {
    height: 140px;
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 155px minmax(0, 1fr);
  }
  .sidebar {
    padding: 27px 12px;
  }
  .brand {
    font-size: 28px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .inspector {
    position: static;
    display: grid;
    grid-template-columns: 180px 1fr;
    column-gap: 24px;
  }
  .inspector > .section-heading {
    grid-column: 1/-1;
  }
  .device {
    grid-row: span 4;
    margin-top: 10px;
  }
  .inspector .brightness {
    grid-column: 1/-1;
    margin-top: 15px;
  }
  .inspector > p,
  .connection-help {
    grid-column: 1/-1;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar > span {
    flex-basis: 100%;
  }
  .connection-hint {
    margin-bottom: 26px;
  }
  .page-heading {
    flex-direction: row;
    align-items: center;
  }
  .page-heading > button {
    font-size: 11px;
    padding: 10px;
  }
}
@media (max-width: 620px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 20px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand {
    font-size: 25px;
  }
  .brand small {
    display: inline;
    font-size: 8px;
    margin-left: 14px;
    letter-spacing: 2px;
  }
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 20px;
  }
  nav button {
    flex-direction: column;
    font-size: 10px;
    gap: 4px;
    position: relative;
    padding: 9px 4px;
  }
  nav .count {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 8px;
    padding: 1px 3px;
  }
  nav button > span {
    font-size: 19px;
    width: auto;
  }
  main {
    padding: 0 18px;
  }
  .topbar {
    padding-top: 18px;
    justify-content: space-between;
  }
  .topbar > span {
    flex-basis: 100%;
  }
  .segmented button {
    padding: 8px 11px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 25px;
  }
  h1 {
    font-size: 33px;
  }
  .card-grid {
    gap: 11px;
  }
  .card-body {
    padding: 13px;
  }
  .card-actions {
    gap: 3px;
    flex-wrap: wrap;
  }
  .card-actions .primary {
    font-size: 11px;
    padding: 8px;
  }
  .favorite-visual {
    height: 100px;
  }
  .image-visual {
    height: 165px;
    padding: 10px;
  }
  .section-heading > .small {
    font-size: 10px;
    text-align: right;
  }
  .panel {
    padding: 20px;
  }
  .filterbar {
    align-items: flex-end;
  }
  .filterbar > .small {
    max-width: 100px;
    text-align: right;
    font-size: 10px;
  }
  .template-grid {
    gap: 9px;
  }
  .template canvas {
    height: 133px;
    padding: 8px;
  }
  .template span {
    font-size: 10px;
    padding: 10px;
  }
  .tip {
    padding: 18px;
    gap: 12px;
  }
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .canvas-preview {
    justify-self: center;
    width: 100%;
  }
  .editor-layout canvas,
  .canvas-preview img {
    width: 180px;
    height: 210px;
  }
  dialog {
    padding: 20px;
  }
  .dialog-actions button {
    font-size: 11px;
    padding: 10px 12px;
  }
  footer {
    font-size: 8px;
    letter-spacing: 0.8px;
    flex-wrap: wrap;
  }
  footer span {
    font-size: 9px;
  }
  #mobileLogout {
    display: block;
  }
  .login-shell {
    margin: 24px auto;
  }
  .login-shell .panel {
    padding: 28px;
  }
  .transfer {
    right: 20px;
  }
  .inspector {
    padding: 20px;
    grid-template-columns: 155px 1fr;
    gap: 12px;
  }
  .device {
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: -20px;
  }
}
