@font-face {
  font-family: "Fusion Pixel";
  src: url("/assets/fonts/fusion-pixel-12px-proportional-zh_hans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --sky: #edf7ff;
  --sky-deep: #d9edff;
  --paper: #ffffff;
  --grass: #c6eac4;
  --grass-deep: #6a9c73;
  --ink: #28394c;
  --muted: #64778a;
  --line: #9bb3c9;
  --blue: #557bb3;
  --blue-deep: #3a5d91;
  --pink: #ffb1c5;
  --error: #a14758;
  --font: "Fusion Pixel", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--sky); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
input, textarea, select { width: 100%; border: 2px solid var(--line); border-radius: 0; background: #f8fcff; padding: 9px 12px; min-height: 46px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-deep); box-shadow: 3px 3px 0 #b5d3f2; background: white; }
input[type="checkbox"] { accent-color: var(--blue); width: 22px; height: 22px; min-height: 0; margin: 0; }
textarea { resize: vertical; min-height: 108px; line-height: 1.65; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
h1 { font-size: 36px; line-height: 1.3; }
h2 { font-size: 24px; line-height: 1.4; }
h3 { font-size: 24px; line-height: 1.4; }
a { color: var(--blue-deep); }
.pixel-box { border: 3px solid var(--ink); box-shadow: 6px 0 0 -3px var(--ink), -6px 0 0 -3px var(--ink), 0 6px 0 -3px var(--ink), 0 -6px 0 -3px var(--ink), 6px 6px 0 #c5d8e8; }
.button { border: 2px solid var(--ink); border-radius: 0; padding: 8px 17px; min-height: 44px; line-height: 1.4; background: white; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button.primary { color: white; background: #466b9f; }
.button.secondary { background: #edf6ff; }
.button.quiet { background: white; border-color: var(--line); box-shadow: none; padding: 6px 14px; min-height: 38px; }
.button.danger { background: #fff0f3; color: var(--error); }
.button.small { min-height: 36px; padding: 5px 12px; font-size: 16px; }
.button.wide { width: calc(100% - 3px); }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.text-button { border: 0; border-bottom: 2px solid currentColor; padding: 1px 0; color: var(--blue-deep); background: none; }
.field-help { font-size: 16px; color: var(--muted); margin-top: 7px; max-width: 60ch; }
.notice { padding: 12px 16px; margin: 16px 0; border: 2px solid #b8cfe1; background: #f4faff; line-height: 1.6; }
.notice.error { color: #843c4a; background: #fff0f3; border-color: #e1abb8; }
.notice.success { color: #416d4c; background: #f2fbef; border-color: #a7cca1; }
.notice.warning { color: #715b37; background: #fffbea; border-color: #d5c58e; }
.sky-cloud { position: fixed; width: 108px; height: 24px; background: #fff; box-shadow: 12px -12px #fff, 36px -24px #fff, 60px -12px #fff, 84px 0 #fff; opacity: .7; pointer-events: none; z-index: -1; }
.cloud-one { top: 14vh; left: 8vw; }
.cloud-two { top: 30vh; right: 12vw; transform: scale(.7); opacity: .55; }
.login-view { min-height: 100vh; padding: 70px 22px; display: grid; place-items: center; }
.login-card { width: min(100%, 480px); padding: 32px 38px 25px; background: white; text-align: center; }
.login-card .site-name { color: var(--blue-deep); font-size: 24px; margin: 8px 0 4px; }
.login-card .intro { font-size: 18px; color: var(--muted); margin-top: 10px; }
.login-card form { margin-top: 26px; text-align: left; }
.login-card label { display: block; margin-bottom: 7px; }
.login-card form .button { margin-top: 20px; }
.login-card .notice { text-align: left; }
.domain { color: var(--muted); font-size: 14px; margin-top: 26px; overflow-wrap: anywhere; }
.pixel-home { height: 112px; width: 168px; margin: 0 auto 10px; position: relative; image-rendering: pixelated; }
.pixel-home .roof { position: absolute; left: 20px; top: 0; width: 128px; height: 28px; background: #627d9d; border: 4px solid var(--ink); clip-path: polygon(24% 0, 76% 0, 76% 14%, 84% 14%, 84% 28%, 92% 28%, 92% 42%, 100% 42%, 100% 100%, 0 100%, 0 42%, 8% 42%, 8% 28%, 16% 28%, 16% 14%, 24% 14%); }
.pixel-home .house { position: absolute; left: 30px; top: 27px; width: 108px; height: 76px; border: 4px solid var(--ink); background: #f4f9ff; }
.pixel-home .house i { position: absolute; display: block; top: 10px; left: 10px; width: 26px; height: 22px; border: 4px solid #52729a; background: #a7d9fc; box-shadow: inset 6px 0 0 #d7f2ff; }
.pixel-home .house i + i { left: 62px; }
.pixel-home .house b { position: absolute; display: block; bottom: 0; left: 38px; width: 26px; height: 28px; border: 4px solid #52729a; border-bottom: 0; background: #bdd0e4; }
.pixel-home .lawn { position: absolute; left: 6px; bottom: 0; height: 12px; width: 156px; background: var(--grass); box-shadow: 8px -4px var(--grass), -4px -4px var(--grass); border-bottom: 4px solid #8bb895; }
.workspace { max-width: 1600px; margin: 0 auto; }
.topbar { min-height: 100px; border-bottom: 3px solid var(--ink); padding: 20px 42px; background: white; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 16px; text-decoration: none; font-size: 28px; line-height: 1.1; }
.brand small { display: block; margin-top: 7px; font-size: 16px; color: var(--muted); }
.tiny-home { display: block; width: 28px; height: 24px; border: 4px solid var(--ink); border-top: 0; background: #c6e5ff; position: relative; margin-top: 10px; }
.tiny-home:before { content: ""; position: absolute; left: -8px; top: -14px; width: 36px; height: 12px; background: var(--ink); clip-path: polygon(25% 0, 75% 0, 75% 33%, 88% 33%, 88% 66%, 100% 66%, 100% 100%, 0 100%, 0 66%, 12% 66%, 12% 33%, 25% 33%); }
.tiny-home:after { content: ""; position: absolute; width: 8px; height: 12px; background: var(--ink); bottom: 0; left: 6px; }
.top-actions { display: flex; align-items: center; gap: 20px; }
.connection { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: var(--grass-deep); }
.connection i { width: 8px; height: 8px; display: block; background: var(--grass-deep); }
.connection.stale { color: var(--error); }
.connection.stale i { background: var(--error); }
.workspace-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 103px); }
.sidebar { border-right: 2px solid #c6d8e7; padding: 32px 18px; display: flex; flex-direction: column; background: #e6f2fb; }
.side-label { font-size: 16px; padding: 0 14px 16px; color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; gap: 10px; }
.sidebar nav button { position: relative; display: flex; align-items: center; gap: 13px; border: 2px solid transparent; padding: 12px 14px; width: 100%; text-align: left; color: #4b6279; background: none; white-space: nowrap; }
.sidebar nav button:hover { background: #f6fbff; }
.sidebar nav button[aria-current="page"] { background: white; border-color: var(--ink); box-shadow: 3px 3px 0 #adc5da; color: var(--ink); }
.nav-icon { width: 16px; height: 16px; flex: 0 0 16px; position: relative; display: block; border: 2px solid currentColor; }
.home-icon { height: 12px; margin-top: 4px; border-top: 0; }
.home-icon:before { content: ""; position: absolute; width: 14px; height: 8px; background: currentColor; top: -7px; left: -1px; clip-path: polygon(35% 0, 65% 0, 65% 25%, 85% 25%, 85% 50%, 100% 50%, 100% 100%, 0 100%, 0 50%, 15% 50%, 15% 25%, 35% 25%); }
.note-icon:after, .lines-icon:after { content: ""; position: absolute; width: 8px; height: 2px; background: currentColor; top: 3px; left: 2px; box-shadow: 0 4px currentColor; }
.box-icon:after { content: ""; position: absolute; width: 4px; height: 5px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; top: 0; left: 4px; }
.draft-dot { width: 7px; height: 7px; background: #d1849c; position: absolute; right: 8px; top: 8px; }
.side-foot { margin-top: auto; padding: 50px 14px 0; font-size: 16px; color: var(--muted); }
.side-foot span { display: block; font-size: 12px; margin-top: 16px; }
.main-content { min-width: 0; padding: 36px 42px 24px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-heading p { font-size: 16px; color: var(--muted); margin-bottom: 7px; }
.page-heading h1:focus { outline: none; }
.panel { background: white; border: 2px solid var(--line); padding: 24px; }
.panel + .panel { margin-top: 22px; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-title p { color: var(--muted); font-size: 16px; }
.home-summary { background: white; border: 2px solid var(--ink); border-top: 8px solid #a8cceb; box-shadow: 5px 5px 0 #c5d8e8; display: flex; align-items: center; justify-content: space-between; padding: 27px 30px; gap: 26px; }
.home-summary .day-label { font-size: 18px; color: var(--muted); }
.day-number { font-size: 42px; margin: 2px 0 6px; line-height: 1.4; }
.day-number small { font-size: 24px; margin-left: 6px; }
.home-summary .pixel-home { margin: 0 2px 0 0; flex: 0 0 168px; }
.presence-list { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.person-state { display: flex; align-items: center; gap: 9px; font-size: 18px; }
.person-state i { width: 8px; height: 8px; background: #a7b4c1; display: block; }
.person-state.online i { background: #729c68; }
.person-state small { color: var(--muted); font-size: 16px; }
.stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 26px 0; margin: 10px 0 3px; }
.stat { padding: 2px 26px; border-right: 2px solid #ccddeb; }
.stat:first-child { padding-left: 0; }
.stat:last-child { border: 0; }
.stat strong { font-size: 36px; font-weight: 400; display: block; line-height: 1.2; }
.stat span { font-size: 16px; color: var(--muted); }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.overview-columns .panel + .panel { margin-top: 0; }
.pet-row + .pet-row { margin-top: 24px; padding-top: 20px; border-top: 2px dashed #d7e4ee; }
.pet-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 11px; }
.pet-heading h3 { font-size: 20px; }
.pet-heading span { font-size: 14px; color: var(--muted); }
.meter-line { display: grid; grid-template-columns: 58px minmax(0, 1fr) 40px; align-items: center; gap: 8px; font-size: 14px; margin-top: 7px; }
meter { width: 100%; height: 16px; border: 2px solid #a9bdcc; border-radius: 0; background: #edf4f8; }
meter::-webkit-meter-bar { background: #edf4f8; border: 0; border-radius: 0; box-shadow: none; }
meter::-webkit-meter-optimum-value { background: #a5cc96; border-radius: 0; }
meter::-webkit-meter-suboptimum-value { background: #dec483; border-radius: 0; }
meter::-webkit-meter-even-less-good-value { background: #d790a0; border-radius: 0; }
.service-list { margin: 0; }
.service-list div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 2px dotted #d8e6f0; }
.service-list div:last-child { border: 0; }
.service-list dt { color: var(--muted); font-size: 16px; }
.service-list dd { margin: 0; font-size: 16px; text-align: right; overflow-wrap: anywhere; }
.config-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.config-intro p { font-size: 16px; color: var(--muted); max-width: 50ch; }
.version-chip { display: inline-block; font-size: 14px; border: 2px solid #acc3d5; padding: 5px 10px; white-space: nowrap; background: white; }
.form-panel { border: 2px solid var(--line); background: white; padding: 22px 24px 24px; margin: 0 0 22px; min-width: 0; }
.form-panel legend { font-size: 24px; padding: 0 9px; margin-left: -9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.form-field { display: flex; flex-direction: column; min-width: 0; }
.form-field > label { margin-bottom: 7px; }
.form-field.full { grid-column: 1 / -1; }
.check-field { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.check-field span { font-size: 18px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 6px; }
.thresholds { display: flex; align-items: center; gap: 8px; }
.thresholds input { min-width: 0; }
.thresholds span { color: var(--muted); }
.text-row { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, 1.5fr) 64px; gap: 12px; margin-bottom: 18px; align-items: start; }
.text-row textarea { min-height: 82px; }
.text-row .button { margin-top: 35px; }
.text-row label { display: block; font-size: 16px; margin-bottom: 6px; }
.text-empty { padding: 6px 0 20px; color: var(--muted); font-size: 16px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 20px; position: sticky; bottom: 0; padding: 18px 0; background: var(--sky); border-top: 2px solid #c5d8e8; z-index: 2; }
.draft-status { font-size: 16px; color: var(--muted); }
.draft-status.dirty { color: var(--blue-deep); }
.table-scroll { overflow-x: auto; border: 2px solid var(--line); background: white; }
table { width: 100%; border-collapse: collapse; font-size: 16px; text-align: left; }
th { font-weight: 400; background: #e5f1fb; color: #48617c; border-bottom: 2px solid var(--line); padding: 13px 16px; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 2px solid #e0ebf3; vertical-align: top; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td.path-cell { min-width: 170px; max-width: 300px; font-size: 14px; color: var(--muted); }
.hash { font-size: 12px; letter-spacing: .1px; overflow-wrap: anywhere; }
.empty-state { border: 2px dashed #aac1d4; background: #f8fcff; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin-bottom: 8px; }
.empty-state p { font-size: 16px; }
.section-intro { font-size: 16px; color: var(--muted); margin: -8px 0 22px; }
.resource-version { font-size: 16px; margin-bottom: 18px; color: var(--muted); }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-top: 2px solid #d1e0eb; margin-top: 32px; padding-top: 20px; font-size: 14px; color: var(--muted); }
.workspace-footer button { font-size: 16px; }
.confirm-dialog { width: min(440px, calc(100vw - 42px)); padding: 26px; background: white; color: var(--ink); }
.confirm-dialog::backdrop { background: rgba(40, 57, 76, .32); }
.confirm-dialog p { margin: 16px 0 24px; font-size: 18px; }
.confirm-dialog .button-row { justify-content: flex-end; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (min-width: 1600px) { .workspace { border-left: 2px solid #c6d8e7; border-right: 2px solid #c6d8e7; } }
@media (max-width: 1100px) {
  .workspace-layout { grid-template-columns: 215px minmax(0, 1fr); }
  .main-content { padding: 30px 26px 24px; }
  .topbar { padding: 20px 26px; }
  .sidebar { padding: 30px 12px; }
  .sidebar nav button { padding: 12px 10px; gap: 10px; }
  .overview-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { min-height: 88px; padding: 18px 20px; }
  .brand { font-size: 24px; gap: 12px; }
  .top-actions { gap: 12px; }
  .connection { font-size: 14px; }
  .workspace-layout { display: block; }
  .sidebar { padding: 14px 16px; border-right: 0; border-bottom: 2px solid #c6d8e7; }
  .side-label, .side-foot { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 10px; padding: 2px 4px 6px 2px; }
  .sidebar nav button { width: auto; flex: 0 0 auto; padding: 9px 12px; font-size: 16px; }
  .nav-icon { display: none; }
  .main-content { padding: 26px 20px 20px; }
  .page-heading { margin-bottom: 22px; gap: 12px; }
  h1 { font-size: 30px; }
  .page-heading .button { font-size: 16px; padding: 8px 12px; }
  .home-summary { padding: 24px; }
  .home-summary .pixel-home { transform: scale(.8); transform-origin: right center; flex-basis: 135px; margin-left: -22px; }
  .day-number { font-size: 36px; }
  .stats-strip { padding: 24px 0; }
  .stat { padding: 0 18px; }
  .stat strong { font-size: 30px; }
  .form-panel { padding: 18px 18px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .config-intro { flex-direction: column; gap: 10px; }
  .text-row { grid-template-columns: minmax(0, 1fr) 64px; gap: 8px 12px; padding: 0 0 20px; border-bottom: 2px dashed #d7e4ee; }
  .text-row .key-field { grid-column: 1 / -1; }
  .text-row .button { margin-top: 35px; }
  .form-actions { gap: 12px; }
  .form-actions > .button-row { width: 100%; }
  .form-actions .button { flex: 1; font-size: 16px; padding: 8px 10px; }
  .workspace-footer { align-items: flex-start; }
}
@media (max-width: 440px) {
  .login-view { padding: 36px 20px; }
  .login-card { padding: 26px 24px 22px; }
  .topbar { padding: 16px; }
  .top-actions .connection { display: none; }
  .main-content { padding: 24px 16px 20px; }
  .home-summary { padding: 20px; align-items: flex-start; }
  .home-summary .pixel-home { display: none; }
  .presence-list { gap: 8px 18px; }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 0 10px; }
  .stat span { font-size: 14px; }
  .stat strong { font-size: 26px; }
  .panel { padding: 20px 18px; }
  .check-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { transition: none !important; } }
