:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  color: #354b42;
  background: #f5f2eb;
  font-size: 14px;
  --green: #3d6552;
  --line: #dedfd2;
  --muted: #7d8b7e;
  --warm: #d9b378;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  background: #faf8f0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: inherit;
  padding: 10px 13px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: #ebeedd;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #688f78;
  outline-offset: 3px;
}
button.active {
  background: #e1e9da;
  border-color: #a9bda5;
  color: #2f5b47;
}
button.primary {
  background: var(--green);
  color: #fffbea;
  border-color: var(--green);
  box-shadow: 0 3px 7px #36563d15;
}
button.primary:hover {
  background: #2f5543;
}
.wide {
  width: 100%;
}
.subtle {
  background: #edeee3;
  border: 0;
}
.header {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  background: #faf8f1;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #314c40;
  font-family: Georgia, serif;
  font-size: 23px;
  letter-spacing: -0.6px;
}
.brand-icon {
  font-size: 37px;
  background: #e7eadd;
  border-radius: 14px;
  width: 46px;
  height: 48px;
  text-align: center;
  line-height: 44px;
}
.brand small {
  display: block;
  font: 9px system-ui;
  letter-spacing: 2.3px;
  margin-top: 7px;
  color: #8c9681;
}
.weather {
  display: flex;
  gap: 14px;
  align-items: center;
}
.weather > span {
  color: #caa459;
  font-size: 32px;
}
.weather strong {
  font-size: 14px;
  font-weight: 600;
}
.weather small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  border: 1px solid #d4ddcb;
  background: #edf0e4;
  border-radius: 30px;
  padding: 6px 10px;
  color: #6a8167;
  font-size: 11px;
  white-space: nowrap;
}
.soft {
  font-size: 10px;
  padding: 4px 8px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  min-height: calc(100vh - 94px);
}
.scene {
  position: relative;
  min-height: 650px;
  height: calc(100vh - 94px);
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 46%,
    #f6f1e2 0,
    #eeeee1 55%,
    #e4e9db 100%
  );
}
.scene:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#9dac9520 0.75px, transparent 0.75px);
  background-size: 14px 14px;
}
.scene-top {
  position: absolute;
  left: 32px;
  right: 28px;
  top: 29px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  pointer-events: none;
}
.scene-top > * {
  pointer-events: auto;
}
.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #929d87;
}
.scene h1 {
  font:
    32px Georgia,
    serif;
  letter-spacing: -0.7px;
  margin: 9px 0;
}
.scene-top p {
  font-size: 12px;
  color: #82907d;
  margin: 0;
}
.view-tabs {
  display: flex;
  background: #faf8f1dd;
  border: 1px solid #dddccc;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 4px 16px #56613f06;
}
.view-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 12px;
  white-space: nowrap;
}
.view-tabs button.active {
  background: #3d6552;
  color: #fff6e6;
  box-shadow: 0 2px 4px #23352220;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.scene-tools {
  position: absolute;
  left: 32px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #faf8f0e8;
  padding: 5px;
  border: 1px solid #dbdecf;
  border-radius: 12px;
  box-shadow: 0 4px 14px #6071570c;
}
.scene-tools button {
  border: 0;
  background: transparent;
  font-size: 21px;
  padding: 3px 10px;
}
.scene-tools span {
  font-size: 11px;
  color: #748571;
}
.scene-tools i {
  height: 20px;
  border-left: 1px solid #dce0d2;
  margin: 0 6px;
}
.scene-note {
  position: absolute;
  right: 28px;
  bottom: 43px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #7c8e76;
}
.live-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #84a076;
  box-shadow: 0 0 0 4px #9cb68c19;
}
.muted-dot {
  background: #b5aa83;
}
.sidebar {
  padding: 28px 23px;
  border-left: 1px solid var(--line);
  background: #faf8f1;
  overflow: auto;
  max-height: calc(100vh - 94px);
}
.aside-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sidebar h2 {
  font:
    22px Georgia,
    serif;
  letter-spacing: -0.4px;
  margin: 15px 0 10px;
}
.muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.family-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 7px;
  margin: 21px 0;
}
.person {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 35px;
  height: 41px;
  background: #e9e6d7;
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar canvas {
  width: 31px;
  height: 39px;
  object-fit: contain;
}
.person strong {
  font-size: 11px;
  font-weight: 600;
}
.person small {
  display: block;
  font-size: 10px;
  color: #8b9481;
  margin-top: 3px;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-heading h3 {
  font:
    18px Georgia,
    serif;
  margin: 0 0 16px;
}
.section-heading > span {
  font-size: 10px;
  color: #a4ae96;
}
.switches {
  display: grid;
  gap: 14px;
}
.switches label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.switches small {
  font-size: 9px;
  color: #97a08e;
}
.switches input {
  margin-left: auto;
  appearance: none;
  width: 29px;
  height: 17px;
  border-radius: 20px;
  background: #d4dacc;
  position: relative;
  cursor: pointer;
}
.switches input:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  background: #faf9f0;
  border-radius: 50%;
  transition: left 0.1s;
}
.switches input:checked {
  background: #6d8d70;
}
.switches input:checked:before {
  left: 15px;
}
.cars {
  display: flex;
  gap: 8px;
  margin-top: 19px;
}
.cars button {
  width: 50%;
  font-size: 10px;
  padding: 10px 8px;
  text-align: left;
}
.cars small {
  display: block;
  color: #8c977f;
  font-size: 9px;
  margin-top: 4px;
}
.field-label {
  display: block;
  font-size: 11px;
  color: #89947e;
  margin-bottom: 7px;
}
select,
input:not([type="checkbox"]):not([type="range"]):not([type="file"]) {
  border: 1px solid var(--line);
  background: #fffdf7;
  border-radius: 8px;
  padding: 10px 11px;
  width: 100%;
  color: inherit;
}
select {
  width: 100%;
  font-size: 12px;
}
.time-control {
  margin: 16px 0;
}
.time-control label {
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.time-control strong {
  font-weight: 500;
  color: #73876b;
}
input[type="range"] {
  width: 100%;
  accent-color: #7b966e;
  height: 20px;
}
.text-button {
  font-size: 10px;
  border: 0;
  background: transparent;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #819276;
}
.room-card {
  padding: 15px;
  background: #eeeede;
  border-radius: 11px;
  margin: 20px 0;
}
.room-card h3 {
  font:
    18px Georgia,
    serif;
  margin: 9px 0;
}
.room-card p {
  font-size: 11px;
  color: #829078;
}
.room-card small {
  display: block;
  font-size: 10px;
  color: #899580;
}
.footnote {
  display: block;
  text-align: center;
  color: #a1aa93;
  font-size: 9px;
  line-height: 1.7;
  margin-top: 15px;
}
.editor-toolbar {
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 20px;
  z-index: 4;
  padding: 14px;
  background: #fbfaf1f5;
  border: 1px solid #cad4bf;
  border-radius: 13px;
  box-shadow: 0 8px 25px #4b674325;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.editor-toolbar > div {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.editor-toolbar strong {
  font:
    18px Georgia,
    serif;
}
.editor-toolbar small {
  font-size: 11px;
  color: #7c8e76;
}
.editor-toolbar select {
  width: 160px;
}
.editor-toolbar button {
  font-size: 11px;
  padding: 9px 10px;
}
[hidden] {
  display: none !important;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #314f41;
  color: #fff7e7;
  padding: 13px 20px;
  border-radius: 10px;
  box-shadow: 0 5px 30px #263b4033;
  max-width: 90vw;
  font-size: 12px;
}
.toast.error {
  background: #9e5345;
}
dialog {
  border: 1px solid #d6dccb;
  border-radius: 18px;
  background: #faf8f0;
  color: inherit;
  width: min(780px, 94vw);
  max-height: 88vh;
  padding: 28px;
  box-shadow: 0 20px 100px #152f4733;
}
dialog::backdrop {
  background: #263f3a70;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.dialog-heading h2 {
  font:
    27px Georgia,
    serif;
  margin: 10px 0 24px;
}
.dialog-heading > button {
  border: 0;
  font-size: 23px;
  padding: 0 8px;
}
.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.settings-tabs button {
  font-size: 12px;
}
.settings-tabs .active {
  background: #e2e9d9;
}
#settings-form section > label {
  display: block;
  font-size: 12px;
  margin: 15px 0;
}
#settings-form input,
#settings-form select {
  margin-top: 7px;
}
#settings-form .check {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#settings-form h3 {
  font:
    20px Georgia,
    serif;
}
input[type="checkbox"] {
  accent-color: #678961;
}
.form-row {
  display: flex;
  gap: 14px;
  margin: 15px 0;
}
.form-row > label {
  flex: 1;
  font-size: 12px;
}
.form-row input[type="color"] {
  height: 40px;
}
.actions {
  display: flex;
  gap: 10px;
}
.file-button {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
}
.file-button input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  cursor: pointer;
}
.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.dialog-footer span {
  font-size: 11px;
  color: var(--muted);
}
#settings-error {
  color: #a75245;
  font-size: 12px;
}
.entity-row {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
}
.entity-row h4 {
  margin: 0;
}
.entity-row > div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.entity-row label {
  font-size: 10px;
  color: #83917a;
}
.entity-row input {
  font-size: 11px !important;
  padding: 8px !important;
}
.connection-status {
  padding: 13px;
  border-radius: 8px;
  background: #edeedc;
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #f9f4e6, #dae3d0);
}
.login-card {
  background: #fffdf5;
  border: 1px solid #d6ddca;
  border-radius: 20px;
  padding: 42px;
  width: min(410px, 92vw);
  box-shadow: 0 15px 70px #4a624717;
}
.login-card h1 {
  font:
    32px Georgia,
    serif;
  letter-spacing: -1px;
}
.login-card h1 span {
  color: #b8955f;
}
.login-card p {
  font-size: 13px;
  color: #8c977f;
  line-height: 1.6;
}
.login-card label {
  display: block;
  font-size: 12px;
  margin: 18px 0;
}
.login-card input {
  margin-top: 8px;
}
.login-card button {
  width: 100%;
  margin: 10px 0;
}
.login-card small {
  font-size: 10px;
  color: #a4ae95;
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: 1fr 350px;
  }
  .sidebar {
    padding: 34px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr 265px;
  }
  .header {
    padding: 0 20px;
  }
  .scene-top {
    flex-direction: column;
    gap: 15px;
    left: 23px;
    top: 22px;
  }
  .scene-top h1 {
    font-size: 27px;
  }
  .sidebar {
    padding: 24px 17px;
  }
  .scene-note {
    display: none;
  }
  .header-actions .pill {
    display: none;
  }
}
@media (max-width: 720px) {
  .header {
    height: 78px;
    padding: 0 15px;
    gap: 10px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-icon {
    display: none;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 1.5px;
  }
  .weather {
    gap: 7px;
  }
  .weather > span {
    font-size: 23px;
  }
  .weather strong {
    font-size: 11px;
  }
  .weather small {
    font-size: 9px;
  }
  .header-actions button {
    padding: 8px;
  }
  .header-actions button span {
    display: none;
  }
  .workspace {
    display: block;
  }
  .scene {
    height: 69vh;
    min-height: 490px;
  }
  .scene h1 {
    font-size: 25px;
  }
  .scene-top {
    top: 20px;
    left: 19px;
  }
  .view-tabs button {
    padding: 8px 11px;
  }
  .sidebar {
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px;
  }
  .family-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .person {
    flex-direction: column;
    align-items: flex-start;
  }
  .scene-tools {
    left: 18px;
    bottom: 18px;
  }
  .editor-toolbar {
    left: 10px;
    right: 10px;
    bottom: 65px;
    padding: 10px;
  }
  .editor-toolbar > div {
    display: block;
  }
  .editor-toolbar small {
    display: block;
    margin-top: 5px;
  }
  .editor-toolbar select {
    width: 130px;
  }
  .entity-row > div {
    grid-template-columns: 1fr;
  }
  .settings-tabs {
    gap: 4px;
    flex-wrap: wrap;
  }
  .settings-tabs button {
    padding: 8px;
  }
  .dialog-footer {
    align-items: flex-start;
    gap: 10px;
  }
  .dialog-footer span {
    max-width: 110px;
  }
  dialog {
    padding: 20px;
  }
  .form-row {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
