:root {
  color-scheme: light;
  font-family: "Noto Sans Thai Looped", "Leelawadee UI", Tahoma, sans-serif;
  color: #172642;
  background: #f3f6fb;
  --ink: #172642;
  --secondary: #4e607b;
  --line: #dbe3ef;
  --paper: #ffffff;
  --blue: #1759bb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; background: radial-gradient(ellipse at 12% 10%, #dceafa, transparent 55%), radial-gradient(ellipse at 94% 50%, #e9eefb, transparent 65%); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--blue); text-underline-offset: .25em; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #2370d4; outline-offset: 3px; }
button:disabled { opacity: .6; cursor: wait; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.3; letter-spacing: -.045em; }
h2 { font-size: 1.2rem; line-height: 1.45; }
p { line-height: 1.65; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: 1rem max(4vw, calc((100vw - 1120px) / 2)); min-height: 70px; background: #ffffffdb; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--ink); font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand svg { color: var(--blue); flex: none; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .65rem 1.1rem; font-size: .9rem; }
.link-button { color: var(--blue); background: transparent; border: 0; padding: .25rem 0; text-decoration: underline; text-underline-offset: .25em; }
main { max-width: 1180px; padding: 0 30px 3rem; margin: 0 auto; }
.startup { padding: 3rem 0; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.25rem; padding: 2.65rem 0 1.55rem; }
.page-heading p { margin-top: .55rem; color: var(--secondary); }
.segmented, .screen-tabs { display: flex; gap: .25rem; align-items: center; padding: .25rem; border-radius: 999px; }
.segmented { background: #dce8fa; }
.segmented button, .screen-tabs button { border: 0; border-radius: 999px; background: transparent; color: inherit; padding: .55rem .95rem; font-weight: 600; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--blue); box-shadow: 0 1px 4px #17458024; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, 320px); gap: 1.1rem; }
.studio { position: relative; isolation: isolate; overflow: hidden; background: #617a98; color: white; border: 1px solid #b4c7df; border-radius: 1.65rem; padding: 1.25rem 1.65rem 1.15rem; min-width: 0; display: grid; align-content: start; justify-items: center; }
.studio-wallpaper { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(155deg, #1228409e, #29445b1a 50%, #13283891); }
.studio-bar { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 1.2rem; }
.studio-bar p { font-weight: 700; }
.studio-bar span { font-variant-numeric: tabular-nums; font-size: .875rem; color: #f0f5ff; }
.wallpaper-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .4rem; }
.wallpaper-actions button, .screen-tabs { border: 1px solid #ffffff75; backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 #ffffff7a, 0 4px 12px #0d213638; }
.wallpaper-actions button { background: #0c253766; color: white; border-radius: 999px; padding: .45rem .8rem; font-size: .88rem; font-weight: 700; }
.wallpaper-actions button:hover { background: #0c2537aa; }
.device { position: relative; width: min(calc(100% - 1.8rem), 548px); padding: clamp(.45rem, 1.5vw, .75rem); background: linear-gradient(145deg, #ffffffc7, #eaf4ff48 85%); border: 1px solid #ffffffb5; backdrop-filter: blur(10px); border-radius: 1.4rem; box-shadow: inset 0 1px 1px #ffffffa8, 0 22px 40px #10243872; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; background: #c1d2e4; border: 1px solid #ffffffc5; border-radius: .9rem; }
.device-rocker { position: absolute; top: 30%; right: -1.1rem; display: grid; gap: .45rem; }
.device-key { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 1px solid #ffffffdc; border-radius: .8rem; color: #213a58; background: linear-gradient(150deg, #fff, #c2d6eb); box-shadow: 0 2px 6px #13273e60; font: 600 .65rem system-ui, sans-serif; }
.device-key:hover { background: #fff; }
.device-key:active { transform: translateY(1px); }
.device-home { border-radius: 50%; margin: .6rem auto 0; }
.device-home span { width: .75rem; height: .75rem; border: 1px solid #2b4e71; border-radius: 50%; }
.screen-tabs { margin: 1.15rem auto 0; width: fit-content; max-width: 100%; justify-content: center; background: #17324a73; }
.screen-tabs button { padding: .5rem .75rem; font-size: .9rem; }
.screen-tabs button[aria-pressed="true"] { background: #fffffff2; color: #153a64; box-shadow: 0 1px 4px #0923424f; }
.wallpaper-feedback, .wallpaper-feedback.ok { color: #fff; padding: .25rem .7rem; background: #182c44cc; border-radius: 999px; font-size: .9rem; }
.side { display: grid; grid-auto-rows: min-content; gap: 1rem; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 1.25rem; }
.side .paper { box-shadow: 0 7px 28px #324c7210, inset 0 1px 0 white; }
.quick-send, .summary { padding: 1.05rem 1.15rem; }
.quick-send > p { margin: .5rem 0 .9rem; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-heading a { font-size: .9rem; white-space: nowrap; }
.primary, .secondary, select { display: inline-flex; justify-content: center; align-items: center; border-radius: .55rem; padding: .6rem .9rem; min-height: 44px; font-weight: 650; }
.primary { background: var(--blue); color: white; border: 1px solid var(--blue); text-decoration: none; }
.primary:hover { background: #124a9c; }
.secondary { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.weather-card { color: #102d57; padding: 1rem 1.15rem; border-color: #fff; background: radial-gradient(ellipse at 92% 16%, #a5d4ff9c, transparent 71%), linear-gradient(145deg, #ffffffec, #d8e8facc 85%); backdrop-filter: blur(20px); }
.weather-card .card-heading span { color: #304e78; font-size: .9rem; }
.weather-card .weather-temp { font-size: 3rem; line-height: 1.15; letter-spacing: -.055em; font-weight: 700; margin: .4rem 0 .2rem; }
.weather-card .weather-range { color: #304e78; font-size: .92rem; }
.weather-card a { display: inline-block; font-size: .8rem; margin-top: .45rem; }
.energy-card { color: var(--ink); padding: 1rem 1.15rem; }
.energy-card > .muted { font-size: .88rem; }
.energy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: .8rem 0; }
.energy-grid div { border-radius: .75rem; background: #eff5fc; min-width: 0; padding: .6rem .65rem; }
.energy-grid dt { font-size: .85rem; color: var(--secondary); }
.energy-grid dd { margin: .12rem 0 0; overflow-wrap: anywhere; font-size: 1.18rem; font-weight: 700; }
.quick-send > .delivery, .delivery { color: var(--secondary); margin: .6rem 0 0; font-size: .88rem; }
.clean-list { list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
.summary li { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; margin-top: .6rem; font-size: .95rem; line-height: 1.55; }
.summary li span, .muted { color: var(--secondary); }
.summary li span { flex-shrink: 0; }
.login { max-width: 460px; margin: clamp(2rem, 7vw, 5rem) auto; padding: clamp(1.2rem, 4vw, 2rem); }
.login h1 { font-size: 2.1rem; }
.login > p { margin: .7rem 0 1.2rem; color: var(--secondary); }
form { display: grid; gap: .95rem; }
form label { display: grid; gap: .35rem; font-weight: 650; }
input, textarea, select { width: 100%; min-width: 0; background: white; border: 1px solid #bccce0; color: var(--ink); border-radius: .5rem; padding: .6rem .7rem; min-height: 44px; font-weight: 400; }
textarea { resize: vertical; }
.feedback { color: #9c301d; margin-top: .35rem; }
.feedback:empty { display: none; }
.feedback.ok { color: #1b6554; }
.mobile { max-width: 620px; margin: 1.25rem auto; }
.mobile-nav { display: flex; gap: .35rem; padding: .3rem; background: #dce8fa; border-radius: .8rem; }
.mobile-nav a { text-align: center; flex: 1; border-radius: .45rem; padding: .58rem .25rem; text-decoration: none; font-weight: 650; color: var(--ink); }
.mobile-nav a[aria-current] { background: var(--paper); }
.panel h1 { margin: 1.25rem 0 1rem; font-size: clamp(2rem, 5vw, 2.65rem); }
.editor { padding: 1.1rem; }
.month-calendar { padding: .85rem 1rem; margin-bottom: .95rem; }
.calendar-sync { font-size: .88rem; margin: -.45rem 0 .8rem; }
.calendar-sources { margin-bottom: .95rem; }
.calendar-sources summary { cursor: pointer; font-weight: 700; }
.calendar-sources form { margin-top: 1rem; }
.calendar-sources li { display: flex; justify-content: space-between; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.calendar-sources li button { flex-shrink: 0; align-self: start; }
.calendar-sources li small { display: block; }
.month-calendar .secondary { min-width: 44px; padding: .25rem .6rem; font-size: 1.45rem; }
.month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; margin-top: .65rem; text-align: center; }
.month-days span { padding: .4rem 0; color: var(--secondary); font-size: .85rem; }
.month-days button { background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: .4rem; min-height: 40px; }
.month-days button:hover { background: #e6eefb; }
.month-days button.today { border-color: #8badde; }
.month-days button.has-event { background: #dfeafe; font-weight: 750; }
.month-days button[aria-pressed="true"] { background: var(--blue); color: white; }
.month-footer { margin-top: .4rem; }
.form-actions { display: flex; gap: .55rem; }
.history-heading { margin-top: 1.45rem; }
.history-heading select { width: auto; }
.item-list { margin-top: .95rem; display: grid; gap: .55rem; }
.item-list li { border: 1px solid var(--line); background: var(--paper); border-radius: .7rem; padding: .8rem 1rem; }
#events-list li { line-height: 1.5; }
.item-list li p { white-space: pre-wrap; }
.item-list time, .item-list li > span { color: var(--secondary); }
.item-actions { display: flex; gap: 1.1rem; margin-top: .4rem; }
@media (max-width: 780px) {
  main { padding-inline: 1rem; }
  .layout { grid-template-columns: 1fr; }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-card { grid-column: 1 / -1; }
  .studio { padding-inline: 1rem; }
}
@media (max-width: 480px) {
  .site-header { padding-inline: 1rem; }
  .header-actions { font-size: .85rem; }
  .page-heading { align-items: start; flex-direction: column; padding-top: 1.5rem; }
  .side { grid-template-columns: 1fr; }
  .screen-tabs button { padding-inline: .6rem; }
}
