/* Check Up — calm dark theme with a hexagonal dot lattice.
   Design goal: a helpful tool, professional but not corporate. */

:root {
  --bg: #15120e;
  --bg-2: #1c1812;
  --surface: #221b14;
  --surface-2: #2b2319;
  --surface-3: #382c1f;
  --line: #3f3223;
  --line-soft: #2c2418;
  --dot: rgba(214, 178, 130, 0.07);
  --text: #f1eadf;
  --text-dim: #b8a98f;
  --text-faint: #857664;
  --accent: #b5835a;
  --accent-2: #d6a15c;
  --warn: #d6a15c;
  --bell: #e8b866;
  --danger: #c56a4e;
  --good: #93a06a;
  --paper: #241c13;
  --paper-line: rgba(214, 178, 130, 0.11);
  --radius: 5px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --tap: rgba(255, 255, 255, 0.05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.4;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
body { user-select: none; }
input, textarea { user-select: text; }

#app { min-height: 100%; }

/* ---- Hexagonal dot lattice background ---- */
.hexgrid {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, var(--dot) 1.4px, transparent 1.6px),
    radial-gradient(circle, var(--dot) 1.4px, transparent 1.6px);
  background-size: 46px 79.67px; /* 46 x 46*sqrt(3) */
  background-position: 0 0, 23px 39.84px;
}

/* ---- generic ---- */
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent); }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 13px; color: var(--text-dim);
}
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-weight: 600; transition: transform .05s, background .15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #9a6a45); border-color: transparent; color: #fff8f0; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; }

.input {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field .lbl { display: block; font-size: 13px; color: var(--text-dim); margin: 0 0 6px 2px; }

/* icon buttons */
.iconbtn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); position: relative;
}
.iconbtn svg { width: 21px; height: 21px; }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.dot-badge {
  position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid var(--bg);
}

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 12px) 14px 12px;
  background: linear-gradient(var(--bg) 60%, rgba(14,17,22,0.0));
  backdrop-filter: blur(4px);
}
.topbar .title { font-size: 20px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--text-faint); }
.brandmark { width: 30px; height: 30px; }

/* ---- auth ---- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow);
}
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-logo svg { width: 58px; height: 58px; }
.auth-logo h1 { font-size: 24px; }
.auth-logo p { margin: 0; color: var(--text-dim); font-size: 14px; text-align: center; }
.tabs2 { display: flex; background: var(--bg-2); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs2 button { flex: 1; padding: 9px; border-radius: 9px; color: var(--text-dim); font-weight: 600; }
.tabs2 button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset; }
.form-error { color: var(--danger); font-size: 14px; margin: 4px 2px 10px; min-height: 18px; }

/* ---- home / rooms ---- */
.home-main { padding: 8px 16px 90px; }
.section-label { font-size: 13px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; margin: 18px 4px 12px; }
.room-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px; justify-items: center; padding: 6px 0;
}
.room-circle {
  width: 132px; height: 132px; border-radius: 50%; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(120% 120% at 30% 25%, var(--surface-3), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; padding: 12px;
  transition: transform .08s;
}
.room-circle:active { transform: scale(0.96); }
.room-circle .rc-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--room, var(--accent)); opacity: .55; }
.room-circle .rc-name { font-weight: 650; font-size: 15px; line-height: 1.15; max-width: 108px; }
.room-circle .rc-meta { font-size: 11.5px; color: var(--text-dim); }
.room-circle .rc-bell {
  position: absolute; top: 8px; right: 8px; background: var(--bell); color: #221a00;
  font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px;
  display: grid; place-items: center; padding: 0 5px;
}
.room-add {
  width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--line); color: var(--text-dim); background: rgba(255,255,255,0.012);
}
.room-add .plus { font-size: 34px; line-height: 1; margin-bottom: 2px; }
.room-add span { font-size: 12px; }
.empty-note { color: var(--text-dim); text-align: center; padding: 40px 20px; font-size: 15px; }

/* ---- room view ---- */
.room-view { min-height: 100dvh; display: flex; flex-direction: column; }
.room-scroll { flex: 1; overflow-y: auto; padding: 12px 14px 24px; }

/* Phone home-screen grid: fixed square cells on 6 columns. Each widget is
   freely placed by its own x/y (grid-column/grid-row set inline) and scaled
   in x and y. The number of rows is set inline (lowest widget + 3). */
.widget-grid {
  --cell: 52px; --wg-gap: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: var(--cell);
  gap: var(--wg-gap);
  align-items: stretch;
  max-width: calc(6 * var(--cell) + 5 * var(--wg-gap) + 8px);
  margin: 0 auto;
}
.widget {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden; min-width: 0;
}
/* "edgeless" / bare widgets: no card chrome, they sit right on the grid */
.widget.bare { background: transparent; border: none; padding: 4px; }
.widget .w-title { font-size: 13px; font-weight: 650; line-height: 1.15; color: var(--text); }
.bare-label { text-align: center; font-size: 12.5px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }

.w-bell.corner { position: absolute; top: 6px; right: 6px; z-index: 2; }
.w-bell {
  width: 22px; height: 22px; border-radius: 6px; background: rgba(232,184,102,0.18);
  color: var(--bell); display: grid; place-items: center; animation: pulse 1.6s ease-in-out infinite;
}
.w-bell svg { width: 13px; height: 13px; }
@keyframes pulse { 0%,100%{ transform: scale(1); opacity: .9; } 50%{ transform: scale(1.18); opacity: 1; } }

/* toggle: a big lightbulb + label, nothing else */
.toggle-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 2px; }
.bulb {
  width: 60px; height: 60px; display: grid; place-items: center; font-size: 40px; line-height: 1;
  filter: grayscale(0.7) brightness(0.6) contrast(0.9); transition: filter .2s, transform .1s;
}
.bulb.on { filter: drop-shadow(0 0 16px rgba(232,184,102,0.7)); transform: scale(1.04); }
.bulb:active { transform: scale(0.92); }

/* yes/no */
.yn { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.yesno { display: flex; gap: 7px; flex: 1; }
.yesno button { flex: 1; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 700; color: var(--text-dim); font-size: 14px; }
.yesno button.yes.on { background: rgba(147,160,106,0.22); border-color: var(--good); color: #e7efd4; }
.yesno button.no.on { background: rgba(197,106,78,0.2); border-color: var(--danger); color: #f4d2c6; }

/* slider: simple native slider + label, no bounding box */
.slider-wrap { display: flex; flex-direction: column; justify-content: center; gap: 8px; height: 100%; padding: 0 4px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 3px; background: var(--surface-3); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(145deg, var(--accent-2), var(--accent)); border: 2px solid var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); cursor: pointer; }
.slider-val { text-align: center; font-weight: 650; font-size: 14px; color: var(--accent-2); }

/* todo — a realistic ruled notepad */
.notepad {
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    repeating-linear-gradient(var(--paper) 0 26px, var(--paper-line) 26px 27px) padding-box;
  border-left: 3px solid rgba(197,106,78,0.55);
  border-radius: 2px 5px 5px 2px; padding: 6px 8px 8px 12px; display: flex; flex-direction: column; gap: 0;
}
.notepad .note-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 26px; letter-spacing: .01em; }
.todo .item { display: flex; align-items: center; gap: 7px; min-height: 27px; }
.todo .item .chk { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; background: rgba(0,0,0,0.15); }
.todo .item .chk.on { background: var(--good); border-color: var(--good); color: #1a1e10; }
.todo .item .txt { flex: 1; font-size: 14px; line-height: 26px; }
.todo .item.done .txt { color: var(--text-faint); text-decoration: line-through; }
.todo .progwrap { display: flex; align-items: center; gap: 4px; }
.todo .bar { width: 40px; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.25); overflow: hidden; }
.todo .bar > i { display: block; height: 100%; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.todo .rm { color: var(--text-faint); font-size: 16px; padding: 0 2px; }
.todo .add { display: flex; gap: 6px; align-items: center; min-height: 27px; }
.todo .add input { flex: 1; padding: 3px 4px; border: none; border-bottom: 1px dashed var(--line); background: transparent; color: var(--text); font-size: 14px; line-height: 22px; }
.todo .add input:focus { outline: none; border-bottom-color: var(--accent); }
.todo .add button { padding: 0 8px; color: var(--accent-2); font-size: 18px; }

/* kanban */
.kanban { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.kcol { flex: 0 0 150px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kcol h4 { font-size: 12px; color: var(--text-dim); font-weight: 650; }
.kcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: 7px 8px; font-size: 13px; }
.kcard .kmeta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; color: var(--text-faint); }
.kcard .kmeta button { font-size: 15px; padding: 0 3px; }
.kcol .kadd { font-size: 13px; color: var(--text-faint); padding: 5px; border-radius: 3px; border: 1px dashed var(--line); text-align: center; }

/* Edgeless "add widget" button below the grid */
.add-widget-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 16px 0 6px; padding: 12px; border: none; background: none;
  color: var(--text-dim); font-size: 14px; font-weight: 600;
}
.add-widget-btn:active { color: var(--accent-2); }
.add-widget-btn svg { width: 18px; height: 18px; }

/* chrome-style section tabs — rounded at the TOP, flush at the bottom */
.tabbar {
  display: flex; align-items: flex-end; gap: 3px; padding: 5px 8px calc(var(--safe-bottom)) 8px;
  background: var(--bg); border-top: 1px solid var(--line-soft); overflow-x: auto; min-height: 44px;
}
.chrome-tab {
  position: relative; padding: 9px 16px 10px; font-size: 13.5px; color: var(--text-dim); font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); border-bottom: none;
  border-radius: 12px 12px 0 0; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis;
}
.chrome-tab.on { background: var(--surface-3); color: var(--text); border-color: var(--accent); border-bottom: none; }
.chrome-tab .close { margin-left: 8px; color: var(--text-faint); }
.tab-add { padding: 8px 12px; color: var(--text-dim); font-size: 20px; align-self: center; }

/* ---- sheets / modals ---- */
#sheet-root .backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(6,8,11,0.6);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease;
}
#sheet-root .backdrop.center { align-items: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + var(--safe-bottom));
  max-height: 86dvh; overflow-y: auto; animation: slideup .22s cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow);
}
.sheet.modal { border-radius: 22px; animation: pop .2s ease; }
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } }
@keyframes pop { from { transform: scale(.96); opacity: .6; } }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 12px; }
.sheet h2 { font-size: 18px; margin-bottom: 4px; }
.sheet .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.sheet-divider { height: 1px; background: var(--line-soft); margin: 14px -18px; }
.sheet-group-label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; margin: 4px 2px 8px; }

/* list rows */
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 12px; }
.lrow:active { background: var(--tap); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.lrow .l-main { flex: 1; min-width: 0; }
.lrow .l-name { font-weight: 600; font-size: 15px; }
.lrow .l-sub { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.lrow .l-sub .mini-bell { color: var(--bell); display: inline-flex; }
.lrow .l-sub .mini-bell svg { width: 12px; height: 12px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.action-row { display: flex; align-items: center; gap: 12px; padding: 13px 8px; border-radius: 12px; font-weight: 600; }
.action-row:active { background: var(--tap); }
.action-row svg { width: 20px; height: 20px; color: var(--text-dim); }
.action-row.danger { color: var(--danger); } .action-row.danger svg { color: var(--danger); }

/* member picker */
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 11px; }
.pick .check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.pick.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.color-picker { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.color-picker button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.color-picker button.on { border-color: #fff; }

/* chat */
.chat-msgs { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; min-height: 180px; }
.msg { max-width: 82%; padding: 8px 11px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg,#2c3f63,#28527f); border-color: transparent; }
.msg .m-who { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.msg .m-body { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.msg .m-time { font-size: 10px; color: var(--text-faint); margin-top: 3px; text-align: right; }
.chat-input { display: flex; gap: 8px; position: sticky; bottom: 0; padding-top: 8px; background: var(--surface); }
.chat-input input { flex: 1; }

/* notifications list */
.notif { display: flex; gap: 10px; padding: 12px 8px; border-radius: 12px; }
.notif.unread { background: rgba(91,141,239,0.07); }
.notif .n-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.notif .n-title { font-weight: 600; font-size: 14px; }
.notif .n-body { font-size: 13px; color: var(--text-dim); }
.notif .n-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(20px + var(--safe-bottom) + var(--kb, 0px)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; transition: bottom .15s; }
.toast { background: var(--surface-3); border: 1px solid var(--line); color: var(--text); padding: 11px 16px; border-radius: 13px; font-size: 14px; box-shadow: var(--shadow); animation: toastin .2s ease; max-width: 90%; }
.toast.bell { border-color: var(--bell); }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

/* install banner */
.install-banner { margin: 10px 4px 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; gap: 12px; }
.install-banner .ib-txt { flex: 1; font-size: 13px; color: var(--text-dim); }

.loading { display: grid; place-items: center; min-height: 100dvh; color: var(--text-dim); }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- widget config: icon picker + slider states ---- */
.icon-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; flex-wrap: wrap; }
.icon-preview { width: 52px; height: 52px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 28px; overflow: hidden; flex: none; }
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid .emoji { height: 38px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 20px; display: grid; place-items: center; }
.emoji-grid .emoji.on { background: var(--surface-3); border-color: var(--accent); }
.bulb-img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; }
.states-list { display: flex; flex-direction: column; gap: 6px; }
.state-row { display: flex; align-items: center; gap: 8px; }
.input.sm { padding: 8px 10px; font-size: 14px; }

/* ---- keyboard insets (set by app.js from visualViewport) ---- */
:root { --kb: 0px; }
#sheet-root .backdrop { bottom: var(--kb, 0px); transition: bottom .12s; }

/* ---- widget activity log ---- */
.w-log { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.log-row { display: flex; align-items: baseline; gap: 6px; padding: 6px 2px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.log-row:last-child { border-bottom: none; }
.log-who { font-weight: 650; color: var(--text); flex: none; }
.log-act { color: var(--text-dim); flex: 1; }
.log-at { color: var(--text-faint); font-size: 11px; flex: none; }

/* ---- room background picker ---- */
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.bg-swatch { position: relative; height: 62px; border-radius: 10px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.bg-swatch.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.bg-swatch .bg-dot { width: 12px; height: 12px; border-radius: 50%; }
.bg-swatch .bg-name { font-size: 11px; color: var(--text-dim); }

/* ---- room long-press menu ---- */
.rc-snooze { position: absolute; top: 8px; left: 8px; font-size: 13px; }
.snooze-row { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.snooze-row .btn { flex: 1; min-width: 60px; }

/* ---- arrange mode (move + x/y scale on the grid) ---- */
.widget-grid.arranging { touch-action: none; }
/* Subtle cell grid behind the widgets while arranging, so placement reads. */
.widget-grid.arranging {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc((100% + var(--wg-gap)) / 6) calc(var(--cell) + var(--wg-gap));
  background-position: 0 0;
  border-radius: 12px;
}
.arrange-card {
  align-items: center; justify-content: center; text-align: center; gap: 3px;
  border-style: dashed; cursor: grab; user-select: none;
  background: var(--surface-2); overflow: visible;
}
.arrange-card .arr-emoji { font-size: 20px; line-height: 1; }
.arrange-card .arr-title {
  font-size: 12px; font-weight: 650; color: var(--text); line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arrange-card .arr-size { font-size: 10px; color: var(--text-dim); }
/* Bottom-right drag handle scales the widget in both x and y. */
.arrange-card .arr-handle {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px;
  display: grid; place-items: center; cursor: nwse-resize; touch-action: none;
  color: var(--accent); z-index: 3;
}
.arrange-card .arr-handle svg { width: 14px; height: 14px; }
.arrange-card.dragging { opacity: 0.9; box-shadow: 0 12px 28px rgba(0,0,0,0.55); border-color: var(--accent); border-style: solid; z-index: 6; }
.arrange-card.resizing { border-color: var(--accent); border-style: solid; z-index: 6; }

/* ---- rooms arrange mode ---- */
.room-grid.arranging { touch-action: none; }
.arrange-room { cursor: grab; border-style: dashed; }
.arrange-room.dragging { opacity: 0.85; box-shadow: 0 12px 30px rgba(0,0,0,0.55); z-index: 5; }
