:root {
  --bg: #1a1b1e; --panel: #232428; --panel-2: #2b2d31; --border: #3a3c42; --text: #e9eaec; --muted: #a3a6ad;
  --accent: var(--accent-color, #5880f9); --green: #2fbf71; --red: #e5484d; --amber: #f5a524;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.sm-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--border); }
.sm-header h1 { flex: 1; margin: 0; font-size: 18px; }
.sm-back { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.sm-main { max-width: 860px; margin: 0 auto; padding: 16px; }
.sm-intro { color: var(--muted); margin: 0 0 14px; }
.sm-btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; font-size: 14px; cursor: pointer; min-height: 40px; }
.sm-btn:hover { border-color: #55585f; }
.sm-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sm-btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.sm-btn-small { padding: 6px 10px; min-height: 34px; font-size: 13px; }
.sm-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }
.sm-input { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 15px; min-height: 42px; }
.sm-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sm-textarea { resize: vertical; min-height: 110px; font-family: inherit; }
.sm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sm-tabs { display: flex; gap: 6px; }
.sm-tab { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.sm-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sm-search { flex: 1; min-width: 180px; }
.sm-banner { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: rgba(229, 72, 77, .14); border: 1px solid rgba(229, 72, 77, .5); }
.sm-banner.warn { background: rgba(245, 165, 36, .12); border-color: rgba(245, 165, 36, .5); }
.sm-list { display: flex; flex-direction: column; gap: 10px; }
.sm-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.sm-card.paused { opacity: .75; }
.sm-card-top { display: flex; gap: 10px; align-items: flex-start; }
.sm-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: #6b6e75; }
.sm-dot.ok { background: var(--green); } .sm-dot.bad { background: var(--red); } .sm-dot.partial { background: var(--amber); }
.sm-card-title { font-weight: 700; word-break: break-word; }
.sm-card-body { color: var(--muted); font-size: 14px; margin-top: 2px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sm-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin: 10px 0 0 20px; }
.sm-pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.sm-pill.active { color: var(--green); border-color: rgba(47, 191, 113, .5); }
.sm-pill.paused { color: var(--amber); border-color: rgba(245, 165, 36, .5); }
.sm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0 20px; }
.sm-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.sm-muted { color: var(--muted); font-weight: 400; }
.sm-hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
/* modal */
.sm-modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px; }
.sm-sheet { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.sm-sheet-small { max-width: 420px; }
.sm-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sm-sheet-head h2, .sm-sheet h2 { margin: 0; font-size: 18px; }
.sm-x { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; min-width: 40px; min-height: 40px; }
.sm-label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.sm-field { border: none; padding: 0; margin: 0; }
.sm-room-actions { margin: 6px 0; font-size: 13px; }
.sm-rooms { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.sm-rooms label, .sm-repeat label, .sm-days label { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; }
.sm-rooms label:hover, .sm-repeat label:hover { background: var(--panel-2); }
.sm-repeat { display: grid; grid-template-columns: 1fr; gap: 2px; }
.sm-days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sm-days label { border: 1px solid var(--border); padding: 6px 10px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sm-preview { background: var(--panel-2); border-radius: 10px; padding: 4px 12px 12px; margin-top: 16px; }
.sm-preview-msg { white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 8px; padding: 10px; min-height: 40px; }
.sm-next { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.sm-errors { background: rgba(229, 72, 77, .14); border: 1px solid rgba(229, 72, 77, .5); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.sm-errors ul { margin: 0; padding-left: 18px; }
.sm-sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sm-check { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; color: var(--muted); }
.sm-history { list-style: none; margin: 0; padding: 0; }
.sm-history li { border-bottom: 1px solid var(--border); padding: 10px 2px; font-size: 14px; }
.sm-history .when { color: var(--muted); font-size: 13px; }
.sm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 30; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: 90vw; }
.sm-toast.err { background: var(--red); }
@media (max-width: 560px) {
  .sm-main { padding: 12px; }
  .sm-modal { padding: 0; }
  .sm-sheet { border-radius: 0; min-height: 100%; border: none; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sm-grid { grid-template-columns: 1fr; }
  .sm-meta, .sm-actions { margin-left: 0; }
  .sm-sheet-foot .sm-btn { flex: 1; }
}
