:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17211d;
  background: #f5f7f6;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 58px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #dce3df; background: #fff;
}
.topbar strong { font-size: 20px; margin-right: 8px; }
.topbar span { color: #66736d; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions a { color: #174f3b; font-size: 14px; text-decoration: none; padding: 8px; }
main { width: min(1040px, calc(100% - 32px)); margin: 36px auto 64px; }
h1, h2, h3, p { margin-top: 0; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px); gap: 64px; align-items: center; margin: 64px auto 84px; }
.project-intro { max-width: 600px; }
.project-intro h1 { max-width: 560px; margin-bottom: 22px; font-size: 48px; line-height: 1.18; }
.project-intro > p:not(.guide-kicker) { color: #53615b; line-height: 1.9; }
.project-points { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; color: #174f3b; font-size: 14px; font-weight: 650; }
.project-points span::before { content: "✓"; margin-right: 6px; }
.auth-panel { width: 100%; background: #fff; border: 1px solid #dce3df; padding: 28px; border-radius: 8px; }
.auth-panel > p, .page-heading p, .device-meta { color: #66736d; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0; border-bottom: 1px solid #dce3df; }
.tabs button { border: 0; background: transparent; padding: 10px; color: #66736d; }
.tabs button.active { color: #174f3b; border-bottom: 2px solid #174f3b; font-weight: 650; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #43514b; font-size: 14px; }
input { min-height: 42px; border: 1px solid #bfc9c4; border-radius: 6px; padding: 8px 10px; background: #fff; }
input:focus { outline: 2px solid #9fc6b7; border-color: #174f3b; }
button { border: 1px solid #aab8b1; background: #fff; color: #174f3b; border-radius: 6px; min-height: 40px; padding: 8px 14px; }
button.primary { border-color: #174f3b; background: #174f3b; color: #fff; }
button.quiet { border: 0; }
.download-link {
  display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 20px;
  border-radius: 6px; background: #174f3b; color: #fff; font-weight: 650; text-decoration: none;
}
.auth-panel .download-note { margin: 8px 0 0; font-size: 13px; text-align: center; }
.hidden { display: none !important; }
.message { margin: 14px 0 0; color: #9b3528; }
.page-heading, .device-header { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.pairing { padding: 14px 16px; margin: 18px 0; border-left: 4px solid #c08b25; background: #fff8e8; }
.pairing strong { font-size: 24px; letter-spacing: 2px; }
.device-list { display: grid; gap: 16px; margin-top: 18px; min-width: 0; }
.device-card { width: 100%; min-width: 0; background: #fff; border: 1px solid #dce3df; border-radius: 8px; padding: 20px; }
.device-header > div { min-width: 0; }
.device-title { margin-bottom: 5px; font-size: 20px; }
.online-state { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; padding: 5px 9px; background: #edf5f1; color: #174f3b; font-size: 13px; }
.online-state.offline { background: #f3f1ee; color: #6d665f; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: #dce3df; border: 1px solid #dce3df; margin: 18px 0; }
.summary-item { background: #fafcfb; padding: 12px; }
.summary-item span { display: block; color: #66736d; font-size: 13px; margin-bottom: 5px; }
.summary-item strong { font-size: 17px; }
details { border-top: 1px solid #e2e7e4; border-bottom: 1px solid #e2e7e4; padding: 12px 0; }
summary { cursor: pointer; color: #174f3b; font-weight: 650; }
.settings-form { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.settings-form .check { display: flex; align-items: center; gap: 8px; }
.settings-form .check input { min-height: 0; }
.settings-form button { justify-self: start; }
.records { margin-top: 18px; overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #e6ebe8; white-space: nowrap; }
th { color: #66736d; font-weight: 550; }
.guide-page { width: min(860px, calc(100% - 32px)); }
.usage-guide { padding-top: 24px; }
.guide-heading { max-width: 680px; }
.guide-heading h1 { margin-bottom: 10px; font-size: 32px; }
.guide-heading > p:last-child { color: #66736d; line-height: 1.7; }
.guide-kicker { margin-bottom: 6px; color: #174f3b; font-size: 13px; font-weight: 700; }
.guide-steps { margin: 32px 0 0; padding: 0; list-style: none; border-top: 1px solid #dce3df; }
.guide-steps li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-bottom: 1px solid #dce3df; }
.step-number {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #174f3b; color: #fff; font-weight: 700;
}
.guide-steps h3, .guide-notes h3 { margin-bottom: 7px; font-size: 17px; }
.guide-steps p, .guide-notes p { margin-bottom: 0; color: #53615b; line-height: 1.75; }
.text-link { display: inline-block; margin-top: 10px; color: #174f3b; font-weight: 650; }
.guide-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 28px 0; }
.privacy-note {
  margin: 0; padding: 14px 16px; border-left: 4px solid #174f3b; background: #edf5f1;
  color: #43514b; line-height: 1.6;
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  main { width: min(100% - 20px, 1040px); margin-top: 20px; }
  .home-layout { grid-template-columns: 1fr; gap: 32px; margin: 36px auto 52px; }
  .project-intro h1 { font-size: 34px; }
  .auth-panel { padding: 22px; }
  .page-heading { display: grid; }
  .device-header { flex-wrap: wrap; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .settings-form { grid-template-columns: 1fr; }
  .device-card { padding: 15px; }
  .usage-guide { padding-top: 20px; }
  .guide-heading h1 { font-size: 28px; }
  .guide-steps li { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .step-number { width: 32px; height: 32px; }
  .guide-notes { grid-template-columns: 1fr; gap: 22px; }
}
