* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #f7f5ef;
  color: #1f2423;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px;
}
section,
.card {
  display: grid;
  gap: 14px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(47,43,35,.10);
}
[hidden] {
  display: none !important;
}
.device-install-panel {
  border-color: #83c9a4;
  background: #f1fbf6;
  box-shadow: none;
}
.device-install-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.device-install-actions .sub-button {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
label { display: grid; gap: 6px; font-weight: 800; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  padding: 10px;
}
textarea { min-height: 110px; resize: vertical; }
.back-link {
  color: #096645;
  font-weight: 900;
  text-decoration: none;
}
.operator-notice {
  gap: 4px;
  border-color: #ffb21c;
  background: #fff9df;
  box-shadow: none;
}
.operator-notice strong {
  color: #5f3b00;
}
.language-select {
  min-height: 38px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  color: #25302c;
  font-size: 13px;
  font-weight: 900;
  padding: 0 10px;
}
.settings-top {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 14px;
  align-items: end;
}
.token-compact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.token-compact label {
  gap: 4px;
}
.token-compact input {
  min-height: 38px;
  padding: 8px 10px;
}
.token-compact .sub-button {
  min-height: 38px;
  white-space: nowrap;
}
.device-link-status {
  display: grid;
  gap: 4px;
}
.device-link-status strong {
  font-size: 16px;
}
.manual-token {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid #ded9ce;
  padding-top: 12px;
}
.button-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.special-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.special-action-row .sub-button {
  background: #2563eb;
  color: #fff;
}
.special-action-row .sub-button:hover {
  background: #1d4ed8;
}
.save-button,
.sub-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
}
.save-button { background: #0f8f63; color: #fff; }
.save-button.is-error { background: #d43d35; color: #fff; }
.save-button.is-success { background: #0f8f63; color: #fff; }
.sub-button { background: #eee8dc; color: #333; }
.sub-button.is-error { background: #d43d35; color: #fff; }
.danger-button { background: #f4dddd; color: #a12b2b; }
.notice { color: #69716e; font-size: 13px; font-weight: 700; line-height: 1.6; }
.result-text {
  min-height: 20px;
  border-radius: 8px;
  padding: 0;
}
.result-text.is-error,
.result-text.is-success {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 900;
}
.result-text.is-error {
  background: #f8dddd;
  color: #a12b2b;
}
.result-text.is-success {
  background: #edf8f3;
  color: #096645;
}
.powered-by {
  color: #69716e;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  padding: 6px;
  background: #f2eee6;
}
.tab-button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  min-height: 42px;
  font-weight: 900;
  cursor: pointer;
}
.tab-button.is-active { background: #0f8f63; color: #fff; }
.tab-panel { display: none; gap: 14px; }
.tab-panel.is-active { display: grid; }
.status-image-list,
.hours-list,
.special-list { display: grid; gap: 10px; }
.status-image-card,
.hours-card,
.special-card {
  display: grid;
  gap: 10px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.status-image-card.is-dragging {
  opacity: .55;
}
.status-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.status-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eee8dc;
  color: #1f2423;
  font-size: 13px;
  font-weight: 900;
}
.status-card-title {
  font-size: 16px;
  font-weight: 900;
}
.drag-button {
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  min-height: 38px;
  padding: 0 12px;
  color: #424b47;
  font-weight: 900;
  cursor: grab;
}
.drag-button:active {
  cursor: grabbing;
}
.color-input {
  width: 46px;
  height: 38px;
  padding: 4px;
}
.status-setting-row,
.line-setting-row,
.time-row,
.special-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.check-row input {
  width: 18px;
  height: 18px;
}
.advanced-summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}
.advanced-body {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}
.radio-stack {
  display: grid;
  gap: 10px;
}
.days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.days-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: #69716e;
  font-size: 12px;
  font-weight: 800;
}
.days-help span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.days-sample {
  width: 18px;
  height: 18px;
  border: 1px solid #ded9ce;
  border-radius: 6px;
  background: #fff;
}
.days-sample.is-on {
  border-color: #0f8f63;
  background: #edf8f3;
}
.day-check {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.day-check input { display: none; }
.day-check:has(input:checked) {
  border-color: #0f8f63;
  background: #edf8f3;
  color: #096645;
}
.theme-choice-card {
  display: grid;
  gap: 10px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.settings-tool-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.settings-tool-link {
  min-height: 42px;
  border-radius: 7px;
  background: #ece7df;
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 700;
  text-decoration: none;
}
.settings-tool-link.is-disabled {
  color: #8a8178;
  cursor: default;
  opacity: .75;
}
.theme-choice-button {
  min-height: 48px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: #f8f6f0;
  color: #25302c;
  font-weight: 900;
  cursor: pointer;
}
.theme-choice-button[aria-pressed="true"] {
  border-color: #0f8f63;
  background: #0f8f63;
  color: #fff;
}
@media (max-width: 560px) {
  .tabs,
  .status-setting-row,
  .line-setting-row,
  .time-row,
  .special-row,
  .button-row,
  .special-action-row,
  .settings-top,
  .settings-tool-links,
  .token-compact,
  .manual-token,
  .status-card-head {
    grid-template-columns: 1fr;
  }
  .status-number {
    width: 28px;
    height: 28px;
  }
  .theme-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

:root {
  --page: #f3f5f4;
  --surface: #ffffff;
  --surface-subtle: #f7f9f8;
  --line: #dce2df;
  --line-strong: #cbd4d0;
  --text: #18201d;
  --muted: #66736e;
  --green: #167642;
  --green-dark: #0e5a31;
  --green-soft: #e9f6ee;
  --orange-soft: #fff2e3;
  --red: #a93737;
  --red-soft: #fbecec;
}
body {
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
}
main { width: min(1180px, 100%); padding: 24px 28px 48px; }
main > section {
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 18px; line-height: 1.35; }
h3 { font-size: 14px; }
.settings-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  margin: -24px -28px 0;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 0 0 100vmax #fff;
  clip-path: inset(0 -100vmax);
}
.settings-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-logo {
  display: block;
  width: 190px;
  height: auto;
}
.brand-home-link {
  display: block;
  flex: 0 0 auto;
}
.settings-top {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
  gap: 16px;
  align-items: stretch;
}
.settings-top > select { display: none; }
.token-compact,
.manual-token,
.theme-choice-card,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}
.token-compact {
  grid-column: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
  align-items: center;
}
.manual-token {
  grid-column: 2;
  grid-row: 1;
  border-top: 1px solid var(--line);
  padding: 18px;
  align-items: end;
}
.advanced-body .token-compact,
.advanced-body .manual-token {
  grid-column: auto;
  grid-row: auto;
}
.theme-choice-card { padding: 18px; }
.card { padding: 18px; }
.notice { color: var(--muted); font-weight: 600; }
label { color: #33403b; font-size: 13px; }
input, select, textarea {
  min-height: 42px;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 118, 66, .12);
}
.language-select {
  width: auto;
  min-width: 132px;
  min-height: 40px;
  border-color: var(--line-strong);
  border-radius: 6px;
  color: var(--text);
}
.back-link {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}
.settings-management-entry {
  margin-top: 4px;
  text-align: center;
}
.settings-management-link {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.settings-management-link:hover {
  color: var(--green-dark);
}
.save-button,
.sub-button,
.danger-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 850;
}
.save-button { background: var(--green); }
.save-button:hover { background: var(--green-dark); }
.sub-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--green-dark);
}
.sub-button:hover { border-color: var(--green); background: var(--green-soft); }
.danger-button {
  border: 1px solid #efcece;
  background: var(--red-soft);
  color: var(--red);
}
.tabs {
  position: sticky;
  top: 8px;
  z-index: 5;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 4px 10px rgba(23, 37, 31, .05);
}
.tab-button {
  min-height: 40px;
  border-radius: 6px;
  color: #4d5b55;
  font-size: 13px;
}
.tab-button.is-active { background: var(--green); }
.theme-choice-grid { gap: 6px; }
.theme-choice-button {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: #43504b;
  font-size: 13px;
}
.theme-choice-button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px var(--green);
}
.status-image-list {
  gap: 14px;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.hours-list,
.special-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.hours-card,
.special-card {
  border: 0;
  border-radius: 0;
  padding: 14px;
}
.hours-card + .hours-card,
.special-card + .special-card { border-top: 1px solid var(--line); }
.status-image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.special-card.is-selected {
  border: 2px solid var(--green);
  border-radius: 8px;
  background: #f7fffb;
}
.special-list.has-selected .special-card {
  display: none;
}
.special-list.has-selected .special-card.is-selected {
  display: grid;
}
.special-list:empty {
  display: none;
}
.special-summary-list {
  display: grid;
  gap: 8px;
}
.special-summary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
  font-weight: 850;
  cursor: pointer;
}
.special-summary-button.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}
.status-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.status-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}
.status-details summary::-webkit-details-marker { display: none; }
.status-details summary::after {
  content: "＋";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 700;
}
.status-details[open] summary::after { content: "−"; }
#hoursEditor > summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 850;
  box-shadow: none;
}
#hoursEditor.is-editing > summary {
  border: 2px solid #ef9d9d;
  background: #fff4f4;
  color: var(--red);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 4px 14px rgba(207, 61, 53, .12);
}
#hoursEditor > summary::before {
  content: "編集中";
  display: none;
  place-items: center;
  min-height: 26px;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  padding: 0 9px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 950;
}
#hoursEditor.is-editing > summary::before {
  display: inline-grid;
}
#hoursEditor > summary::after {
  border-color: var(--line-strong);
  color: var(--green-dark);
}
#hoursEditor.is-editing > summary::after {
  border-color: #efb6b6;
  color: var(--red);
}
.status-details-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}
.schedule-edit-help {
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}
.hours-list.has-selected .hours-card {
  display: none;
}
.hours-list:not(.has-selected) {
  display: none;
}
.hours-list.has-selected .hours-card.is-selected {
  display: block;
}
.hours-card.is-selected {
  border: 2px solid var(--red);
  border-radius: 8px;
  background: #fffafa;
  box-shadow:
    inset 5px 0 0 var(--red),
    0 8px 22px rgba(207, 61, 53, .12);
}
.timer-editor-card {
  display: grid;
  gap: 12px;
  max-width: 560px;
}
.timer-time-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 18px;
  align-items: end;
}
.timer-time-separator {
  align-self: end;
  padding-bottom: 9px;
  color: #17251f;
  font-size: 18px;
  font-weight: 700;
}
.timer-status-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 38px;
  align-items: end;
}
.timer-fixed-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
  color: #17251f;
  font-size: 14px;
  font-weight: 850;
}
.timer-fixed-check input {
  width: 24px;
  height: 24px;
  margin: 0;
}
.timer-fixed-check small {
  color: #17251f;
  font: inherit;
}
.timer-delete-button {
  justify-self: start;
  min-width: 72px;
  border-radius: 8px;
}
.hours-card.is-unset .timer-editor-card {
  opacity: .78;
}
.hours-card.is-unset .timer-time-row,
.hours-card.is-unset .timer-status-row {
  display: none;
}
.timer-unset-note {
  display: none;
  border: 1px dashed var(--red);
  border-radius: 6px;
  background: rgba(207, 61, 53, .10);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
}
.hours-card.is-unset .timer-unset-note {
  display: block;
}
.calendar-preview-frame {
  width: 100%;
  max-width: 430px;
  height: 335px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.schedule-timeline {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.timeline-warning {
  display: grid;
  gap: 4px;
  border: 1px solid #efcece;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}
.schedule-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.schedule-section-head > div {
  min-width: 0;
}
.schedule-section-head .sub-button {
  flex: 0 0 auto;
  min-width: 128px;
}
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 8px;
}
.timeline-day {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.timeline-day.is-warning {
  border-color: #ef9d9d;
  box-shadow: inset 0 0 0 1px #ef9d9d;
}
.timeline-set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
}
.timeline-set-name {
  min-width: 0;
  width: min(260px, 100%);
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #17251f;
  font-size: 16px;
  font-weight: 900;
  padding: 4px 6px;
}
.timeline-set-name-wrap {
  position: relative;
  min-width: 0;
  width: min(260px, 100%);
}
.timeline-set-name-wrap .timeline-set-name {
  width: 100%;
}
.timeline-set-name-wrap.is-default-name .timeline-set-name {
  padding-right: 28px;
}
.timeline-set-name-wrap.is-default-name::after {
  content: "✎";
  position: absolute;
  right: 8px;
  top: 50%;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
  transform: translateY(-50%);
}
.timeline-set-name:hover,
.timeline-set-name:focus {
  border-color: var(--line-strong);
  background: #fff;
  outline: none;
}
.timeline-set-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.timeline-copy-button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--green-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.timeline-copy-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.timeline-delete-button {
  min-height: 30px;
  border: 1px solid #efcece;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.timeline-delete-button:hover {
  background: #f7dada;
}
.timeline-days-summary {
  display: grid;
  gap: 8px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
}
.timeline-day-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.timeline-special-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.timeline-special-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #3c4742;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.timeline-special-button.is-open {
  border-color: var(--line);
  color: #3c4742;
  background: #fff;
}
.timeline-special-button.is-closed {
  border-color: var(--line);
  color: #3c4742;
  background: #fff;
}
.timeline-special-button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  box-shadow: none;
}
.timeline-day-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #3c4742;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.timeline-day-button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}
.timeline-day-button:hover {
  border-color: var(--green);
}
.timeline-day-button:disabled {
  cursor: default;
  opacity: .5;
}
.hours-card-days {
  display: none;
}
.timeline-track {
  position: relative;
  height: 520px;
  background:
    repeating-linear-gradient(
      to bottom,
      #f4f1eb 0,
      #f4f1eb 19px,
      #e2ddd4 19px,
      #e2ddd4 20px
    );
}
.timeline-hour-labels {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42px;
  background: rgba(230, 226, 218, .88);
  color: #17251f;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}
.timeline-hour-labels span {
  position: absolute;
  left: 5px;
  transform: translateY(-50%);
}
.timeline-block {
  position: absolute;
  left: 46px;
  right: 8px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--block-color) 72%, #222);
  border-radius: 4px;
  background: color-mix(in srgb, var(--block-color) 30%, #fff);
  color: #17251f;
  padding: 6px 7px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.timeline-block:hover,
.timeline-block.is-selected {
  box-shadow: 0 0 0 2px rgba(15, 143, 99, .22);
  z-index: 4;
}
.timeline-block.is-selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(207, 61, 53, .28);
}
.timeline-block strong,
.timeline-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-problem {
  position: absolute;
  left: 46px;
  right: 8px;
  display: grid;
  place-items: start;
  border: 1px dashed var(--red);
  border-radius: 4px;
  background: rgba(207, 61, 53, .12);
  color: var(--red);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 4px;
  z-index: 3;
}
.timeline-problem:hover {
  background: rgba(207, 61, 53, .2);
}
.status-number {
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--green-dark);
}
.drag-button {
  border-color: var(--line-strong);
  border-radius: 6px;
  min-height: 36px;
  color: #4d5b55;
}
.day-check {
  border-color: var(--line);
  border-radius: 6px;
}
.day-check:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}
.result-text.is-error,
.result-text.is-success { border-radius: 6px; }
.result-text.is-error { background: var(--red-soft); color: var(--red); }
.result-text.is-success { background: var(--green-soft); color: var(--green-dark); }
@media (max-width: 760px) {
  main { padding: 16px 14px 36px; }
  .settings-header {
    align-items: flex-start;
    margin: -16px -14px 0;
    padding: 14px;
  }
  .settings-brand { align-items: flex-start; }
  .brand-logo { width: 155px; }
  .settings-top { grid-template-columns: 1fr; }
  .token-compact,
  .manual-token {
    grid-column: 1;
    grid-row: auto;
  }
  .theme-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-setting-row,
  .line-setting-row,
  .time-row,
  .special-row { grid-template-columns: 1fr; }
  .card, .theme-choice-card { padding: 15px; }
  .calendar-preview-frame {
    max-width: none;
    height: 390px;
  }
  .timeline-grid { grid-template-columns: 1fr; }
  .timeline-track { height: 500px; }
}
@media (max-width: 520px) {
  .settings-header,
  .settings-brand { display: grid; }
  .language-select { width: 100%; }
  .token-compact,
  .manual-token,
  .button-row,
  .device-install-actions,
  .schedule-section-head,
  .timer-time-row,
  .timer-status-row,
  .status-card-head { grid-template-columns: 1fr; }
  .schedule-section-head {
    display: grid;
    align-items: stretch;
  }
  .tabs { position: static; }
  .days-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .timeline-grid { grid-template-columns: 1fr; }
  .timeline-track { height: 480px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
