@import url('/fonts.css');

.device-settings {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 12px
}

.device-settings label:first-child {
  width: 85px
}

.device-settings button {
  margin-bottom: 12px
}

.device-settings .check {
  align-self: center;
  white-space: nowrap;
  font-size: 10px
}

.seat-card,.simulation-card { padding:12px 14px; margin-top:12px }
.seat-views { display:flex; gap:5px; flex-wrap:wrap; margin:8px 0 }
.seat-views button { font-size:11px; padding:5px 8px }
#seat-canvas { display:block; width:100%; height:210px; border-radius:8px; touch-action:none; cursor:grab }
#seat-chart { display:block; width:100%; height:72px; border-radius:6px }
.condition-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px }
.condition-grid label { min-width:0 }
.condition-grid input,.condition-grid select,.condition-grid textarea { width:100%; min-width:0; box-sizing:border-box }
.choice-group { border:1px solid var(--line); border-radius:8px; margin:6px 0; padding:8px; grid-column:1/-1 }
.choice-group legend { font-size:11px; color:var(--muted) }
.choice-group label { display:inline-flex; margin-right:12px; margin-bottom:4px }
.choice-group input,.condition-grid input[type=checkbox] { width:auto }
.simulation-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px }
.simulation-form .condition-grid { grid-column:1/-1 }
.simulation-log { padding-left:18px; max-height:190px; overflow:auto; font-size:12px; line-height:1.7; color:var(--muted) }
#simulation-status { font-size:12px; color:var(--green) }
details summary { cursor:pointer; font-size:12px; margin:8px 0 }
@media(max-width:600px) { .seat-card,.simulation-card {padding:12px} .simulation-form {grid-template-columns:1fr} #seat-canvas{height:220px} }
:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #263b36;
  background: #f3f5ef;
  font-size: 14px;
  --green: #28634e;
  --pale: #e5eee4;
  --line: #e1e6dd;
  --muted: #829087
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

button,
input,
select {
  font: inherit
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #355147;
  padding: 7px 10px;
  transition: background .15s, transform .15s
}

button:hover {
  background: #eef3eb
}

button:active {
  transform: translateY(1px)
}

button:disabled {
  opacity: .5;
  cursor: wait
}

input,
select,
textarea {
  border: 1px solid #dce3d8;
  border-radius: 8px;
  padding: 6px 9px;
  background: #fafcf8;
  color: #30463d;
  min-width: 0;
  outline: none;
  width: 100%
}

input:focus,
select:focus,
textarea:focus {
  border-color: #598c6d;
  box-shadow: 0 0 0 3px #28634e10
}

select {
  padding-right: 26px
}

input[type=checkbox] {
  width: auto;
  accent-color: var(--green)
}

input[type=range] {
  padding: 0;
  accent-color: var(--green)
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #677c6d;
  margin: 8px 0
}

h1,
h2,
p {
  margin: 0
}

h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -1px
}

h2 {
  font-size: 15px;
  font-weight: 600
}

small {
  font-size: 10px
}

a {
  color: inherit;
  text-decoration: none
}

.primary {
  background: var(--green);
  color: white;
  border-color: var(--green)
}

.primary:hover {
  background: #1e513e
}

.quiet {
  border-color: transparent;
  background: transparent
}

.danger {
  color: #b86653
}

.small {
  padding: 5px 10px;
  font-size: 12px
}

.icon {
  padding: 2px 7px;
  border: 0;
  background: transparent;
  font-size: 23px
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #8d9e8a;
  font-weight: 700;
  margin-bottom: 6px
}

.muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8
}

.hint {
  font-size: 10px;
  color: #93a08d;
  line-height: 1.8
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px
}

.lease-label { color: var(--green); font-size: 13px; font-weight: 600 }
.lease-actions { margin-bottom: 12px; flex-wrap: wrap }
.user-create { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 12px; padding: 14px; align-items: end; margin-bottom: 14px }
.user-create label { min-width: 0; margin: 0 }
.user-create input { width: 100%; min-width: 0 }
.user-list { display: grid; gap: 8px }
.user-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; overflow-wrap: anywhere }
.user-row > div { flex: 1; min-width: 120px }
#account-settings { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.password-form .primary, #password-form .primary { margin-top: 16px }
.login-card.mcp-consent { width: min(480px, calc(100vw - 32px)); margin: 24px auto; padding: 30px }
.mcp-consent .hint { overflow-wrap: anywhere }
.mcp-connect { padding: 14px; margin-bottom: 12px }
.mcp-url-row { display: flex; gap: 8px; margin: 10px 0 }
.mcp-url-row input { flex: 1; min-width: 0 }
.mcp-scopes { min-width: 0; border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 10px }
.mcp-scopes label { display: inline-flex; align-items: center; white-space: nowrap; margin: 4px 12px 4px 0 }
.mcp-scopes input[type=checkbox] { width: auto; flex: none }
.mcp-scopes legend { font-size: 12px; color: var(--muted) }
.mcp-consent .actions button { flex: 1; width: auto; white-space: nowrap; margin-top: 0 }
.mcp-consent .actions { margin-top: 18px }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px
}

.form-row {
  display: flex;
  gap: 10px
}

.form-row label {
  flex: 1
}

.grow {
  flex: 2 !important
}

.check {
  display: flex;
  flex-direction: row;
  align-items: center
}

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 75% 20%, #d5e4d1, transparent 55%), #eff3e9;
  position: relative
}

.login-card {
  background: #ffffffd9;
  border: 1px solid white;
  border-radius: 25px;
  padding: 46px;
  width: 420px;
  box-shadow: 0 20px 80px #526c4310
}

.login-card h1 {
  font-size: 25px;
  margin-bottom: 8px
}

.login-card .primary {
  width: 100%;
  margin-top: 20px
}

.brand-mark {
  font-family: Georgia, serif;
  font-size: 64px;
  display: block;
  color: var(--green);
  line-height: 1;
  margin-bottom: 28px
}

.login-foot {
  position: absolute;
  bottom: 28px;
  color: #8b9c86;
  font-size: 11px;
  letter-spacing: 3px
}

.error {
  color: #bc614a;
  margin-top: 15px;
  line-height: 1.5
}

header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 32px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  font-size: 36px;
  color: var(--green)
}

.brand span {
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: 2px
}

.brand b {
  font-weight: 700
}

.brand small {
  display: block;
  letter-spacing: 2.4px;
  font-size: 8px;
  color: #94a18e;
  margin-top: 5px
}

nav {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: center
}

nav button {
  border: 0;
  background: transparent;
  color: #859080;
  border-radius: 0;
  height: 100%;
  padding: 0 12px;
  position: relative
}

nav button.active {
  color: var(--green);
  font-weight: 600
}

nav button.active:after {
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  background: var(--green);
  content: ""
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px
}

.tag {
  font-size: 10px;
  letter-spacing: 1px;
  background: #eef3e8;
  color: #738367;
  padding: 6px 10px;
  border-radius: 5px
}

.tab-panel {
  padding: 18px 24px;
  max-width: 1700px;
  margin: auto
}

.workspace-top,
.page-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px
}

.workspace-top select {
  width: 190px
}

.workspace-grid {
  display: grid;
  grid-template-columns: 200px minmax(360px, 1fr) 300px;
  gap: 12px;
  align-items: start
}

.library {
  padding: 12px;
  min-height: 0
}

.scene-list {
  display: grid;
  gap: 8px
}

.scene-item {
  background: #f8faf5;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px
}

.scene-item.active {
  background: #eaf1e5;
  border-color: #c4d7ba;
  color: var(--green)
}

.scene-item small {
  color: #8c9b86
}

.asset-head {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
  margin-bottom: 7px
}

.asset {
  border-bottom: 1px solid #f1f3ed;
  padding: 8px 0;
  display: flex;
  gap: 8px;
  align-items: center
}

.asset-icon {
  width: 28px;
  height: 30px;
  background: #f1f3ed;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #819470;
  font-size: 11px
}

.asset-info {
  flex: 1;
  min-width: 0
}

.asset-info b {
  font-size: 11px;
  font-weight: 500;
  display: block;
  word-break: break-all
}

.asset-info small {
  color: #9aa590
}

.asset button {
  font-size: 13px;
  padding: 2px;
  color: #a0aa97
}

.library-note {
  font-size: 10px;
  line-height: 1.9;
  color: #9da796;
  margin-top: 14px
}

.composition {
  display: grid;
  gap: 12px
}

.preview-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch
}
.preview-pair > .card { min-width: 0; margin-top: 0 }
.preview-pair > .preview { display: flex; flex-direction: column; padding: 12px }
.preview-pair .pet { margin: auto; max-width: 100% }
.shared-preview-controls { grid-column: 1/-1; padding: 10px 12px }
.shared-preview-controls input { min-width: 0 }
@media(max-width:900px) {
  .preview-pair { grid-template-columns: 1fr }
  .preview-pair .pet { margin: 34px auto 25px }
}

.preview {
  overflow: hidden;
  background: linear-gradient(145deg, #fdfefb, #eaf0e3);
  padding: 20px 25px 16px
}

.preview-top {
  display: flex;
  justify-content: space-between
}

.preview-label {
  font-size: 10px;
  color: #98a28e
}

.pet {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 34px auto 25px;
  width: 350px;
  max-width: 100%;
  height: 193px;
  background: linear-gradient(150deg, #f9f6e9, #e6e2cf);
  border: 1px solid #e8e5d4;
  border-radius: 80px 80px 65px 65px;
  box-shadow: 0 16px 20px #73825b12, inset 0 -4px 12px #d9d2b9
}

.pet-ear {
  position: absolute;
  z-index: 0;
  top: -22px;
  width: 70px;
  height: 60px;
  background: #ede9d9;
  border: 1px solid #e2dfcb;
  border-radius: 40px 40px 15px 15px;
  transform: rotate(-24deg);
  left: 20px
}

.pet-ear.right {
  left: auto;
  right: 20px;
  transform: rotate(24deg)
}

.eye-panels {
  display: flex;
  position: relative;
  gap: 16px;
  padding: 14px;
  border-radius: 52px;
  background: #dddccf;
  box-shadow: inset 0 2px 5px #99998033
}

.eye-panels canvas {
  width: 115px;
  height: 115px;
  border-radius: 30px;
  background: #000;
  image-rendering: auto
}

.pet-nose {
  position: absolute;
  bottom: 17px;
  width: 13px;
  height: 8px;
  border-radius: 60%;
  background: #aca58d
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #dde5d5;
  padding-top: 16px
}

.preview-controls button {
  font-size: 11px;
  padding: 8px 12px
}

.preview-controls input {
  flex: 1
}

.preview-controls span {
  font-size: 10px;
  color: #8a9882;
  white-space: nowrap
}

.scene-editor {
  padding: 12px 14px
}

.timeline {
  margin: 6px 0 12px
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: #8c9c85;
  margin: 6px 0
}

.timeline-row span {
  width: 30px
}

.timeline-lane {
  height: 20px;
  flex: 1;
  background: repeating-linear-gradient(90deg, #f4f6ef 0, #f4f6ef calc(25% - 1px), #e6ebdf calc(25% - 1px), #e6ebdf 25%);
  border-radius: 4px;
  position: relative;
  overflow: hidden
}

.timeline-clip {
  position: absolute;
  top: 3px;
  height: 14px;
  background: #b6ccac;
  border-radius: 3px;
  min-width: 1px
}

.timeline-row:nth-child(2) .timeline-clip {
  background: #dec89c
}

.timeline-row:nth-child(3) .timeline-clip {
  background: #b3c6d6
}

.timeline-row:nth-child(4) .timeline-clip {
  background: #d7b7c1
}

.track-editor {
  border-top: 1px solid #edf0e8;
  padding-top: 8px
}

.track-title {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600
}

.track-title label {
  margin: 0
}

.track-editor .form-row {
  align-items: center
}

.track-editor .form-row label {
  font-size: 10px;
  margin: 6px 0
}

.track-editor select,
.track-editor input {
  font-size: 11px;
  padding: 6px
}

.track-editor .track-asset {
  flex: 2
}

.envelope {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  margin: 6px 0
}

.envelope input {
  font-size: 10px;
  padding: 5px
}

.rule-panel {
  padding: 12px
}

.condition-block { min-width: 0; padding: 8px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px }
.condition-block > label:first-child { font-weight: 600 }
.condition-block .hint { line-height: 1.7; overflow-wrap: anywhere }
.condition-block .choice-group { margin: 0 }
.combine-settings, .condition-block, .scene-picker { grid-column: 1/-1 }
.scene-picker { min-width: 0; border: 1px solid var(--line); padding: 0 8px 8px; border-radius: 8px; margin-bottom: 8px }
.scene-picker summary { font-weight: 600; overflow-wrap: anywhere }
.scene-choices { display: grid; gap: 8px; max-height: 220px; overflow-y: auto }
.scene-choices label { margin: 0; overflow-wrap: anywhere }
.empty-track { display: block; padding-left: 8px; line-height: 25px; color: var(--muted) }
.workspace-top .actions { flex-wrap: wrap; justify-content: flex-end }
#current-project-name { margin-bottom: 0; overflow-wrap: anywhere }
#save-copy-form .primary { margin-top: 12px }

.rule-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 7px;
  margin-bottom: 5px;
  background: #f7f9f4;
  cursor: pointer
}

.rule-row.active {
  background: #e9f1e4;
  box-shadow: inset 2px 0 var(--green)
}

.rule-row div {
  flex: 1
}

.rule-row b {
  font-size: 11px;
  font-weight: 500
}

.rule-row small {
  display: block;
  color: #8d9d84;
  margin-top: 3px
}

.rule-panel form {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px
}

.rule-panel label {
  font-size: 10px;
  margin: 6px 0
}

.rule-panel input,
.rule-panel select {
  padding: 6px;
  font-size: 11px
}

.rule-panel .form-row {
  gap: 6px
}

.dispatch {
  margin-top: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px
}

.dispatch h2 {
  margin-bottom: 7px
}

.dispatch-actions {
  display: flex;
  gap: 10px;
  align-items: end
}

.dispatch-actions label {
  width: 230px;
  margin: 0
}

.dispatch-actions button {
  height: 38px;
  font-size: 12px
}

.dispatch-actions option {
  font-size: 12px
}

.dirty {
  font-size: 10px;
  font-weight: 400;
  background: #fff1ce;
  color: #a17f29;
  padding: 5px 8px;
  vertical-align: middle;
  border-radius: 5px;
  letter-spacing: 0
}

.job-strip {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #e5efdd;
  font-size: 12px
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
  margin-top: 14px
}

.device-card {
  padding: 16px
}

.device-card h2 {
  font-family: monospace;
  font-size: 17px
}

.online {
  color: #3d855c
}

.offline {
  color: #a5afa0
}

.device-meta {
  font-size: 11px;
  color: #8b9a85;
  line-height: 1.8;
  margin: 10px 0;
  overflow-wrap: anywhere
}

.device-state {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 12px
}

.search {
  max-width: 350px;
  background: white
}

.job-row {
  display: grid;
  grid-template-columns: 180px 180px 1fr 120px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 12px
}

.job-row small {
  font-size: 10px;
  color: #91a087;
  display: block;
  margin-top: 5px
}

.empty {
  padding: 18px 8px;
  text-align: center;
  color: #9aa68f;
  font-size: 11px;
  line-height: 1.9
}

footer {
  padding: 14px 24px 18px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #a6b09b;
  letter-spacing: 2px
}

footer span {
  letter-spacing: 1px
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  width: min(520px, 90vw);
  box-shadow: 0 25px 100px #20362c33
}

dialog::backdrop {
  background: #263b3660;
  backdrop-filter: blur(4px)
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px
}

dialog code,
dialog pre {
  display: block;
  background: #f4f6ef;
  padding: 12px;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

dialog .primary {
  margin-top: 15px
}

.modal-note {
  font-size: 12px;
  color: #809276;
  line-height: 1.8
}

#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #263b36;
  color: white;
  padding: 13px 24px;
  border-radius: 10px;
  box-shadow: 0 6px 30px #263b3620;
  z-index: 100;
  font-size: 12px;
  max-width: 80vw;
  line-height: 1.6
}

.busy-overlay {
  opacity: .6;
  pointer-events: none
}

.project-import-status {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important
}

@media(min-width:1450px) {
  .workspace-grid {
    grid-template-columns: 210px minmax(500px, 1fr) 300px
  }

  .pet {
    margin-top: 40px;
    margin-bottom: 35px
  }
}

@media(max-width:1150px) {
  .workspace-grid {
    grid-template-columns: 180px minmax(320px, 1fr)
  }

  .rule-panel {
    grid-column: 1/-1
  }

  .rule-panel form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
  }

  .rule-panel form>p,
  .rule-panel form>.actions {
    grid-column: 1/-1
  }

  .workspace-top {
    align-items: start;
    flex-direction: column
  }

  .dispatch {
    align-items: start;
    flex-direction: column
  }

  header {
    gap: 20px;
    padding: 0 20px
  }

  .tab-panel {
    padding: 16px 20px
  }

  .job-row {
    grid-template-columns: 160px 1fr
  }
}

@media(max-width:700px) {
  .user-create { grid-template-columns: 1fr }
  header { flex-wrap: wrap; height: auto !important; min-height: 68px; padding: 12px 16px !important; gap: 8px !important }
  header nav { order: 3; width: 100%; justify-content: center; min-width: 0 }
  header nav button { flex: 1; padding: 12px 6px !important }
  .header-right { margin-left: auto }
  header {
    height: 68px
  }

  .brand span {
    display: none
  }

  nav {
    gap: 0
  }

  nav button {
    padding: 0 10px;
    font-size: 12px
  }

  .header-right {
    gap: 0
  }

  .header-right .tag {
    display: none
  }

  .workspace-grid {
    display: flex;
    flex-direction: column
  }

  .library,
  .composition,
  .rule-panel {
    width: 100%
  }

  .library {
    min-height: auto
  }

  .scene-list {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .scene-item { min-width: 0 }
  .scene-item span { min-width: 0; overflow-wrap: anywhere }
  .scene-item small { flex-shrink: 0 }

  .workspace-top .actions {
    flex-wrap: wrap
  }

  .rule-panel form {
    display: block
  }

  .dispatch-actions {
    flex-wrap: wrap
  }

  .dispatch-actions label {
    width: 100%
  }

  .preview {
    padding: 18px 12px
  }

  .pet {
    width: 300px
  }

  .preview-controls {
    gap: 6px
  }

  .preview-controls span {
    font-size: 9px
  }

  .job-row {
    grid-template-columns: 1fr
  }

  .login-card {
    padding: 30px;
    width: 90vw
  }

  footer span {
    display: none
  }

  .page-top {
    align-items: start;
    flex-direction: column
  }
}

/* Keep touch controls usable while reducing empty space on narrow screens. */
@media(max-width:700px) {
  #app button, #app input:not([type=checkbox]):not([type=range]), #app select { min-height:36px }
  header { padding:8px 12px !important }
  header nav button { padding:8px 4px !important }
  .tab-panel { padding:14px 12px }
  .workspace-top .actions { gap:6px; justify-content:flex-start }
  .preview-pair .pet { margin:28px auto 18px }
  .device-grid { grid-template-columns:minmax(0,1fr) }
  .user-create { gap:10px }
  footer { padding:12px }
}
