:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1d2521;
  background: #f2f3f0;
  --muted: #5a655f;
  --line: #dfe4df;
  --soft: #f5f7f4;
  --accent: #d2f76a;
  --accent-ink: #294219;
  --error: #982c32;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "PingFang SC", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #537b25; outline-offset: 3px; }
p, h1, h2 { margin: 0; }

.frame { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid #d9ded8; background: #f9faf7; }
.masthead-inner { display: flex; align-items: center; gap: 16px; min-height: 111px; }
.brand-icon {
  display: grid;
  flex: 0 0 52px;
  height: 52px;
  place-items: center;
  background: var(--accent);
  color: #263622;
  border: 1px solid #badd54;
  border-radius: 15px;
}
.folder-icon {
  position: relative;
  display: inline-block;
  width: 1.09em;
  height: .75em;
  margin-top: .16em;
  border: 1px solid currentColor;
  border-radius: .14em;
  vertical-align: middle;
}
.folder-icon::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -.24em;
  width: .51em;
  height: .25em;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: .11em .13em 0 0;
}
.brand-icon .folder-icon { font-size: 25px; border-width: 2px; }
.brand-icon .folder-icon::before { left: -2px; border-width: 2px; }
.masthead-copy { flex: 1; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.035em; font-weight: 760; }
.masthead-copy p { margin-top: 7px; color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  font: .8125rem var(--mono);
  white-space: nowrap;
  color: #46534c;
  border: 1px solid #dbe1da;
  border-radius: 7px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 22px;
  padding-block: 27px 44px;
}
.results { display: grid; gap: 18px; min-width: 0; }
.card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 3px #26382b07, 0 12px 28px -24px #24382c52;
}
.setting, .command { padding: 21px 23px; }
.setting + .setting { border-top: 1px solid #e6eae5; }
.section-heading, .preview-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2 { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; line-height: 1.4; font-weight: 720; }
.section-icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  color: #405746;
  background: #edf2eb;
}
.grid-icon::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 8px 0, 0 8px, 8px 8px;
}
.calendar-icon::before {
  content: "";
  width: 14px;
  height: 13px;
  border: 1px solid currentColor;
  border-top: 4px solid currentColor;
  border-radius: 2px;
}
.location-icon::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: -3px;
  border: 1px solid currentColor;
  border-radius: 50% 50% 50% 1px;
  transform: rotate(-45deg);
}
.location-icon::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}
.terminal-icon { font: 700 1rem/1 var(--mono); letter-spacing: -.13em; }

.select-all, .device-label, .target-option { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.select-all { font-size: .875rem; white-space: nowrap; color: #47564d; }
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: #53743b;
  cursor: pointer;
}
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; margin-top: 14px; }
.device {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #29352e;
}
.device:has(input:checked) { border-color: #dce7d4; background: #f2f7ee; }
.device:hover { border-color: #a7ba9d; }
.device-label { align-self: stretch; flex: 1; min-width: 0; padding: 6px 9px; font-size: .875rem; line-height: 1.35; }
.device-name { overflow-wrap: anywhere; white-space: break-spaces; }
.device-actions { display: flex; gap: 2px; padding-right: 4px; }
.device-action {
  display: inline-grid;
  width: 27px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #506151;
  font-size: 1rem;
}
.device-action:hover { background: #e0eade; }
.device-action:last-child:hover { color: var(--error); background: #f7e8e6; }
.device-action:disabled { opacity: .55; }
.device-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 10px; }
.add-device {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px dashed #becab9;
  border-radius: 7px;
  color: #365836;
  background: #fff;
  font-weight: 650;
  font-size: .875rem;
  line-height: 1.3;
}
.add-device span { font: 1.125rem/1 var(--mono); }
.add-device:hover { background: #f1f6ed; border-color: #739463; }
.sync-trigger {
  padding: 6px 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #365836;
  background: transparent;
  font-size: .875rem;
  font-weight: 650;
}
.sync-trigger:hover { background: #f1f6ed; border-color: #dce7d4; }
.sync-state { color: var(--muted); font-size: .8125rem; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e4e9e2;
  border-radius: 8px;
  background: var(--soft);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented span { display: block; padding: 4px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.segmented input:checked + span { background: #fff; border-color: var(--line); color: #2a3c2b; font-weight: 650; }
.segmented input:focus-visible + span { outline: 2px solid #537b25; outline-offset: 2px; }
.date-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.date-fields .field { flex: 1 1 140px; min-width: 0; }
.field { display: grid; gap: 6px; color: #37453d; font-size: .875rem; font-weight: 620; }
.field input, .line-input {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 7px 10px;
  border: 1px solid #dbe2db;
  border-radius: 7px;
  background: #fcfdfa;
  color: #26332c;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}
.field input[type="date"] { display: block; appearance: none; }
.line-input { display: block; resize: none; white-space: pre; overflow: auto; scrollbar-width: none; }
.line-input::placeholder, .command-output::placeholder { color: #68766e; opacity: 1; }
[aria-invalid="true"].line-input, .field input[aria-invalid="true"] { border-color: #ba5657; }
.project-field, .path-field { margin-top: 13px; }
.optional { margin-left: 4px; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.target-options { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 6px; margin-top: 13px; }
.target-option {
  min-height: 37px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: .875rem;
  line-height: 1.35;
}
.target-option:has(input:checked) { background: #f2f7ee; border-color: #dce7d4; }

.preview { overflow: hidden; color: #e6eee7; background: #1a2520; border-color: #202e26; }
.preview-header { padding: 19px 21px; border-bottom: 1px solid #34463a; background: #202d25; }
.preview-heading-icon { font-size: 1.125rem; color: #d8f58c; }
.count {
  padding: 5px 9px;
  border: 1px solid #526845;
  border-radius: 6px;
  background: #2b3c2b;
  color: #dceace;
  font-size: .8125rem;
  white-space: nowrap;
}
.count strong { margin-right: 2px; color: var(--accent); font: 700 .9375rem var(--mono); }
.preview-body {
  min-height: 272px;
  padding: 17px 20px 19px;
  background-image: radial-gradient(circle, #8fa99316 1px, transparent 1px);
  background-size: 15px 15px;
}
.tree-scroll { max-height: 352px; overflow: auto; padding: 0 4px; scrollbar-color: #667965 #26382d; }
.tree-scroll:focus-visible { outline-color: #abc974; }
.tree, .tree ul { margin: 0; padding: 0; list-style: none; }
.tree ul { padding-left: 25px; }
.tree-node { position: relative; min-width: max-content; }
.tree-line { position: relative; display: flex; align-items: center; gap: 9px; min-height: 24px; font: .875rem/1.55 var(--mono); white-space: pre; }
.tree-line .folder-icon { color: #8cac87; font-size: .75rem; }
.tree-line.branch-line { color: #e1f59f; font-weight: 650; }
.branch-line .folder-icon { color: #d5ed8a; }
.tree ul > .tree-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: -19px;
  width: 12px;
  height: 100%;
  border-left: 1px solid #4e6656;
}
.tree ul > .tree-node:last-child::before { height: 12px; }
.tree ul > .tree-node > .tree-line::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -19px;
  width: 12px;
  border-top: 1px solid #4e6656;
}
.preview-error { margin: 3px 4px; color: #ffbcb7; font-size: .9375rem; }
.more-dates { margin-top: 8px; padding: 5px 9px; color: #def5a0; border: 1px solid #4e6656; border-radius: 6px; background: #27392c; font-size: .875rem; }

.command-help { margin: 9px 0 12px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.command-output {
  display: block;
  width: 100%;
  height: 84px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid #e1e7df;
  border-radius: 8px;
  background: #f4f6f3;
  color: #27382b;
  font: .875rem/1.55 var(--mono);
}
.command-output:not(:placeholder-shown) { height: 156px; }
.command-actions, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 13px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
}
.button-primary { background: var(--accent); color: #283322; border-color: #bddd61; }
.button-primary:hover:not(:disabled) { background: #c3ee55; border-color: #a8cd4a; }
.button-secondary { background: #fff; color: #334339; border-color: #d7dfd7; }
.button-secondary:hover:not(:disabled) { background: #eff4ed; border-color: #aebdac; }
.button:disabled { color: #66736b; background: #edf0ec; border-color: #e4e9e3; }
.copy-icon { position: relative; width: 11px; height: 12px; border: 1px solid currentColor; border-radius: 2px; }
.copy-icon::before { content: ""; position: absolute; inset: -4px 2px 2px -4px; border: 1px solid currentColor; border-right: 0; border-bottom: 0; border-radius: 2px 0 0 0; }
.copy-status { color: #3b613b; font-size: .875rem; }
.field-message { margin-top: 8px; color: var(--error); font-size: .875rem; line-height: 1.55; }

dialog {
  width: min(420px, calc(100% - 32px));
  padding: 23px;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 65px #111c1550;
}
dialog::backdrop { background: #1a292276; }
dialog h2 { margin-bottom: 16px; }
.dialog-actions { justify-content: flex-end; margin-top: 17px; }
.sync-help { margin-bottom: 12px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.sync-form { display: flex; align-items: end; gap: 8px; margin-top: 15px; }
.sync-form .field { flex: 1; min-width: 0; }
.sync-form .button { flex-shrink: 0; }
.sync-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
#share-code { font-family: var(--mono); font-size: .875rem; }

@media (max-width: 820px) {
  .frame { width: min(640px, calc(100% - 36px)); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 19px; }
  .results { gap: 16px; }
  .masthead-inner { min-height: 94px; }
}
@media (max-width: 480px) {
  .frame { width: calc(100% - 24px); }
  .masthead-inner { gap: 11px; min-height: 90px; }
  .brand-icon { flex-basis: 43px; height: 43px; border-radius: 12px; }
  .brand-icon .folder-icon { font-size: 22px; }
  .masthead-copy p { margin-top: 5px; font-size: .875rem; }
  .platform { display: none; }
  .setting, .command, .preview-header { padding: 15px 13px; }
  .preview-body { padding: 14px 13px; }
  .device-label { padding-inline: 6px; gap: 6px; }
  .device-actions { flex-direction: column; gap: 0; }
  .device-action { width: 24px; height: 24px; }
  .date-fields .field { flex-basis: 124px; }
  .target-options { gap: 7px; }
}
