/* Per-room Routines tile — compact routine tiles (see routines-room.js) */
.rr-card .whole-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px; }
.rr-card .whole-head h3{ margin:0; }
.rr-grid{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.rr-grid .routine-tile.rr-tile{ min-height:96px; padding:12px 12px 10px; border-radius:18px; gap:4px; }
.rr-grid .routine-tile.rr-tile .name{ font-size:18px; line-height:1.05; }
.rr-grid .routine-tile.rr-tile .kicker{ font-size:10px; }
.rr-grid .routine-tile.rr-tile .hint{ font-size:11px; }
.rr-in-card{ margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.rr-in-card.rr-card{ background:none; border-left:0; border-right:0; border-bottom:0; box-shadow:none; border-radius:0; padding-left:0; padding-right:0; padding-bottom:0; }
.rr-steps{ margin:6px 0 10px 18px; padding:0; color:var(--muted); font-size:13px; line-height:1.5; }
.note.warn{ color:#f1c27d; }

/* ---- R1 "Living scenes" routine tiles (routines-room.js). Transform/opacity only; phase from --ph so re-renders don't restart. ---- */
.rr-card{ --ph:0s; }
.rr-grid .routine-tile.rr-tile.rr1{ position:relative; overflow:hidden; isolation:isolate; display:grid; grid-template-rows:56px auto auto 1fr;
  align-content:start; justify-items:start; text-align:left; gap:3px; min-height:150px; padding:12px; background:#0d131c; border:1px solid rgba(255,255,255,.08);
  box-shadow:0 12px 26px -14px rgba(0,0,0,.75); transition:transform .18s var(--ease), border-color .18s; }
.rr-grid .routine-tile.rr1:active{ transform:scale(.97); }
.rr1 .kicker{ grid-row:2; }
.rr1 .name{ grid-row:3; }
.rr1 .hint{ grid-row:4; margin-top:2px !important; align-self:start; }
.rr1.wake .kicker{ color:#ffc46b; } .rr1.wel .kicker{ color:#72d9f8; } .rr1.pause .kicker{ color:#b69cff; }
.rr1 .rr-scene{ position:absolute; inset:0; z-index:-2; overflow:hidden; pointer-events:none; }
.rr1 .rr-scene > *{ position:absolute; }
.rr1 .rr-fade{ position:absolute; inset:0; z-index:-1; pointer-events:none; background:linear-gradient(180deg, rgba(9,13,19,0) 30%, rgba(9,13,19,.88) 62%); }
/* Wake Up — sunrise over a horizon */
.rr1.wake .sky0{ inset:0; background:linear-gradient(180deg,#0e1424,#1a2236); }
.rr1.wake .sky{ inset:0; background:linear-gradient(180deg,#1b2140 0%,#5a3a5e 26%,#e0835a 44%,#0d131c 46%); opacity:.15; animation:rrDawn 10s ease-in-out infinite; animation-delay:var(--ph); }
@keyframes rrDawn{ 0%{opacity:.15} 55%,80%{opacity:.95} 100%{opacity:.15} }
.rr1.wake .sun{ right:16px; top:14px; width:46px; height:46px; border-radius:50%; background:radial-gradient(circle,#fff3c4,#ffc46b 45%,rgba(255,150,80,0) 72%);
  animation:rrRise 10s ease-in-out infinite; animation-delay:var(--ph); }
@keyframes rrRise{ 0%{transform:translateY(36px) scale(.9);opacity:.3} 55%,80%{transform:translateY(0) scale(1.05);opacity:1} 100%{transform:translateY(36px) scale(.9);opacity:.3} }
.rr1.wake .below{ left:0; right:0; top:62px; bottom:0; background:#0d131c; }
.rr1.wake .hz{ left:0; right:0; top:62px; height:1px; background:linear-gradient(90deg,transparent,rgba(255,220,170,.6),transparent); }
/* Welcome Home — door opens and throws light */
.rr1.wel .room{ inset:0; background:linear-gradient(180deg,#0f1622,#0b1018); }
.rr1.wel .door, .rr1.wel .leaf{ right:16px; top:10px; width:28px; height:48px; border-radius:4px 4px 0 0; }
.rr1.wel .door{ background:linear-gradient(180deg,#fff2cf,#ffc77a); box-shadow:0 0 22px rgba(255,210,140,.55); }
.rr1.wel .leaf{ background:#1c2738; border:1px solid rgba(255,255,255,.1); transform-origin:left center; animation:rrDoor 10s ease-in-out infinite; animation-delay:var(--ph); }
@keyframes rrDoor{ 0%,10%{transform:perspective(160px) rotateY(0)} 30%,75%{transform:perspective(160px) rotateY(-70deg)} 92%,100%{transform:perspective(160px) rotateY(0)} }
.rr1.wel .beam{ right:-8px; top:58px; width:150px; height:90px; background:linear-gradient(200deg,rgba(255,214,150,.42),rgba(255,214,150,0) 70%);
  clip-path:polygon(76% 0,95% 0,100% 100%,0 100%); opacity:0; animation:rrBeam 10s ease-in-out infinite; animation-delay:var(--ph); }
@keyframes rrBeam{ 0%,12%{opacity:0} 32%,72%{opacity:1} 92%,100%{opacity:0} }
/* Pause All Sonos — equalizer bounces then settles into a pause */
.rr1.pause .bg2{ inset:0; background:linear-gradient(180deg,#141428,#0c0f1a); }
.rr1.pause .eq{ right:14px; top:12px; display:flex; gap:4px; align-items:flex-end; height:40px; }
.rr1.pause .eq i{ width:5px; height:40px; border-radius:3px; background:linear-gradient(180deg,#d9ccff,#7c5cff); transform-origin:bottom; animation:rrEq1 10s ease-in-out infinite; animation-delay:var(--ph); }
.rr1.pause .eq i:nth-child(2), .rr1.pause .eq i:nth-child(4){ animation-name:rrEq2; }
.rr1.pause .eq i:nth-child(3){ animation-name:rrEq3; }
@keyframes rrEq1{0%{transform:scaleY(.4)}6%{transform:scaleY(1)}12%{transform:scaleY(.5)}18%{transform:scaleY(.9)}24%{transform:scaleY(.35)}30%{transform:scaleY(.8)}40%,85%{transform:scaleY(.08)}100%{transform:scaleY(.4)}}
@keyframes rrEq2{0%{transform:scaleY(.8)}6%{transform:scaleY(.3)}12%{transform:scaleY(1)}18%{transform:scaleY(.45)}24%{transform:scaleY(.9)}30%{transform:scaleY(.4)}40%,85%{transform:scaleY(.08)}100%{transform:scaleY(.8)}}
@keyframes rrEq3{0%{transform:scaleY(.55)}6%{transform:scaleY(.9)}12%{transform:scaleY(.3)}18%{transform:scaleY(1)}24%{transform:scaleY(.5)}30%{transform:scaleY(.6)}40%,85%{transform:scaleY(.08)}100%{transform:scaleY(.55)}}
.rr1.pause .pg{ right:20px; top:16px; width:20px; height:22px; display:flex; gap:5px; opacity:0; animation:rrPg 10s ease-in-out infinite; animation-delay:var(--ph); }
.rr1.pause .pg i{ flex:1; background:#e7ddff; border-radius:2px; }
@keyframes rrPg{ 0%,40%{opacity:0;transform:scale(.6)} 48%,82%{opacity:1;transform:none} 90%,100%{opacity:0} }
/* Armed: confirm overlay with a 5 s countdown ring (second tap runs; expiry cancels) */
.rr1.rr-armed{ border-color:rgba(114,217,248,.6) !important; }
.rr1 .rr-cf{ position:absolute; inset:0; z-index:3; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:8px; text-align:center;
  border-radius:inherit; background:rgba(114,217,248,.95); color:#06121c; animation:rrCfIn .22s var(--ease) both; }
@keyframes rrCfIn{ from{opacity:0;transform:scale(1.04)} to{opacity:1;transform:none} }
.rr1 .rr-cf svg{ width:30px; height:30px; transform:rotate(-90deg); }
.rr1 .rr-cf circle{ fill:none; stroke:#06121c; stroke-width:3; stroke-linecap:round; stroke-dasharray:63; stroke-dashoffset:0; animation:rrCount 5s linear forwards; animation-delay:var(--el, 0s); }
@keyframes rrCount{ from{stroke-dashoffset:0} to{stroke-dashoffset:63} }
.rr1 .rr-cf b{ font-family:"Oswald",sans-serif; font-size:17px; font-weight:600; line-height:1.05; }
.rr1 .rr-cf small{ font-size:9.5px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
@media (prefers-reduced-motion: reduce){
  .rr1 .rr-scene *, .rr1 .rr-cf, .rr1{ animation:none !important; transition:none !important; }
  .rr1.wake .sky{ opacity:.9; } .rr1.wake .sun{ transform:none; opacity:1; } .rr1.wel .leaf{ transform:perspective(160px) rotateY(-70deg); } .rr1.wel .beam{ opacity:1; }
  .rr1.pause .eq i{ transform:scaleY(.08); } .rr1.pause .pg{ opacity:1; }
  .rr1 .rr-cf circle{ animation:rrCount 5s linear forwards !important; animation-delay:var(--el, 0s) !important; }
}
