/* Foray — calm, cream, botanical green. Plain CSS on purpose: old iPad mini
   Safari (no grid, no custom properties, prefixed flexbox) and a Tizen web view.
   Layout uses floats and inline-block; flexbox only where it is a nicety. */

/* palette
   cream   #f3eee4   page
   paper   #fbf8f1   cards
   line    #e2dacb
   ink     #23261f
   muted   #7b776a
   green   #2e4a39   botanical, "on"
   sage    #dfe7d9   soft green wash
   clay    #b06f45   accent
   alert   #a5402a */

html, body { margin: 0; padding: 0; background: #f3eee4; color: #23261f;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: rgba(0,0,0,0); box-sizing: border-box; -webkit-box-sizing: border-box; }
h1, h2, h3, .wordmark, .stat-v { font-family: Georgia, "Times New Roman", serif; font-weight: normal; }
button { font-family: inherit; }
.hidden { display: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 20px 48px; }

/* ---- masthead -------------------------------------------------------- */
.masthead { padding: 20px 0 0; overflow: hidden; }
.brand { float: left; }
.wordmark { font-size: 26px; letter-spacing: 1px; }
.place { margin-left: 10px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #7b776a; }
.masthead-right { float: right; padding-top: 8px; font-size: 13px; color: #7b776a; }
.masthead-right a, .masthead-right span { margin-left: 16px; }
.masthead-right a { color: #2e4a39; text-decoration: none; border-bottom: 1px solid #c9d3c3; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; background: #dfe7d9; color: #2e4a39; }

.hello { padding: 30px 0 6px; }
.hello h1 { margin: 0; font-size: 40px; line-height: 1.1; }
.hello p { margin: 8px 0 0; color: #7b776a; font-size: 16px; }

/* ---- sections ------------------------------------------------------- */
.sec { margin-top: 30px; }
.sec-head { margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 24px; }
.sec-head .sub { margin: 2px 0 0; color: #7b776a; font-size: 14px; }
.cols { overflow: hidden; }
.col-main { float: left; width: 61%; }
.col-side { float: right; width: 35%; }
.col-side .sec-head h2 { font-size: 20px; }

.ic { display: inline-block; width: 24px; height: 24px; vertical-align: middle; color: #2e4a39; }
.ic svg { display: block; }

/* ---- now strip -------------------------------------------------------- */
.now { margin-top: 24px; }
.stats { background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 14px; overflow: hidden; }
.stat { float: left; width: 20%; padding: 16px 18px; border-left: 1px solid #ece5d8; min-height: 98px; }
.stat:first-child { border-left: 0; }
.stat .ic { color: #b06f45; }
.stat-v { font-size: 26px; margin-top: 6px; line-height: 1.1; }
.stat-k { font-size: 12px; color: #7b776a; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 3px; }
.stat.alert { background: #f7e3dc; }
.stat.alert .stat-v, .stat.alert .ic { color: #a5402a; }

/* ---- programs ----------------------------------------------------------- */
.programs { overflow: hidden; margin: 0 -6px; }
.program { float: left; width: 50%; padding: 0 6px 12px; position: relative; }
.program > * { position: relative; }
.program:before { content: ""; position: absolute; left: 6px; right: 6px; top: 0; bottom: 12px;
  background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 14px; }
.program-top { padding: 16px 18px 0; }
.program-top .ic { margin-right: 10px; }
.program h3 { display: inline; margin: 0; font-size: 21px; vertical-align: middle; }
.program .desc { margin: 8px 18px 0; color: #5f5c52; font-size: 14px; min-height: 40px; }
.program .run { display: block; margin: 14px 18px 16px; padding: 10px 0; width: 110px;
  border: 0; border-radius: 22px; background: #2e4a39; color: #fbf8f1; font-size: 15px; cursor: pointer; }
.program.busy .run { background: #7d907f; }
.program.done:before { background: #dfe7d9; border-color: #c4d2bd; }

/* ---- automations ---------------------------------------------------------- */
.rules { background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 14px; }
.rule { position: relative; padding: 16px 150px 16px 60px; border-top: 1px solid #ece5d8; cursor: pointer; min-height: 72px; }
.rule:first-child { border-top: 0; }
.rule > .ic { position: absolute; left: 20px; top: 18px; color: #9a968a; }
.rule.on > .ic { color: #2e4a39; }
.rule h3 { margin: 0; font-size: 18px; }
.rule .desc { margin: 3px 0 0; color: #5f5c52; font-size: 14px; }
.rule:not(.on) .desc { color: #9a968a; }
.rule-right { position: absolute; right: 18px; top: 50%; margin-top: -14px; }
.rule-state { display: inline-block; width: 72px; text-align: right; margin-right: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #9a968a; vertical-align: middle; }
.rule.on .rule-state { color: #2e4a39; }
.rule.busy { opacity: 0.55; }

/* ---- switch ------------------------------------------------------------- */
.switch { display: inline-block; vertical-align: middle; position: relative; width: 48px; height: 28px;
  border-radius: 14px; background: #d8d1c2; -webkit-transition: background .2s; transition: background .2s; }
.switch .knob { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2);
  -webkit-transition: -webkit-transform .2s; transition: transform .2s; }
.on > .switch, .on .rule-right .switch { background: #2e4a39; }
.on > .switch .knob, .on .rule-right .switch .knob { -webkit-transform: translateX(20px); transform: translateX(20px); }

/* ---- rooms & devices ------------------------------------------------------ */
.room { background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 14px; margin-bottom: 12px; padding: 4px 0; }
.room h3 { margin: 10px 18px 2px; font-size: 13px; font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase; letter-spacing: 1.6px; color: #7b776a; }
.device { position: relative; padding: 11px 76px 11px 52px; min-height: 48px; cursor: pointer; }
.device + .device { border-top: 1px solid #ece5d8; }
.device > .ic { position: absolute; left: 16px; top: 12px; color: #9a968a; }
.device.on > .ic { color: #2e4a39; }
.device-label { font-size: 16px; line-height: 26px; }
.device-v { position: absolute; right: 18px; top: 11px; line-height: 26px; color: #7b776a; font-size: 14px; }
.device.toggle .device-v { display: none; }
.device > .switch { position: absolute; right: 16px; top: 10px; }
.device.sensor { cursor: default; }
.device.sensor .device-v { color: #23261f; font-family: Georgia, serif; font-size: 17px; }
.device.button .device-label { color: #2e4a39; }
.device.button .device-v { color: #2e4a39; }
.device.busy { opacity: 0.55; }

.stats.n1 .stat { width: 100%; } .stats.n2 .stat { width: 50%; }
.stats.n3 .stat { width: 33.33%; } .stats.n4 .stat { width: 25%; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 899px) {
  .col-main, .col-side { float: none; width: auto; }
  .stats .stat, .stats.n4 .stat { width: 33.33%; border-top: 1px solid #ece5d8; }
  .stats.n2 .stat, .stats.n4 .stat { width: 50%; }
}
@media (max-width: 560px) {
  .page { padding: 0 14px 40px; }
  .hello h1 { font-size: 32px; }
  .program { width: 100%; }
  .stats .stat, .stats.n3 .stat { width: 50%; }
  .rule { padding-right: 76px; }
  .rule-state { display: none; }
  .masthead-right .meta { display: none; }
}

/* ---- login ----------------------------------------------------------------- */
.login { max-width: 340px; margin: 0 auto; padding: 110px 20px 0; text-align: center; }
.login h1 { font-size: 40px; margin: 0 0 4px; letter-spacing: 1px; }
.login .tag { color: #7b776a; margin: 0 0 26px; font-size: 14px; }
.login input { width: 100%; font-size: 22px; padding: 12px; text-align: center; -webkit-appearance: none;
  border: 1px solid #e2dacb; border-radius: 12px; background: #fbf8f1; margin: 0 0 12px; color: #23261f; }
.login button { width: 100%; font-size: 17px; padding: 13px; border: 0; border-radius: 24px;
  background: #2e4a39; color: #fbf8f1; -webkit-appearance: none; }
.login .err { color: #a5402a; min-height: 22px; margin-top: 12px; }

/* ---- TV face: ten-foot tile grid, d-pad navigation --------------------------- */
body.tv { background: #1b1d19; color: #f3eee4; font-size: 28px; }
body.tv .page { max-width: none; padding: 0 60px 60px; }
body.tv .masthead { padding-top: 40px; }
body.tv .wordmark { font-size: 48px; }
body.tv .masthead-right { font-size: 22px; color: #a7a292; padding-top: 18px; }
body.tv .group h2 { margin: 34px 0 14px; font-size: 22px; font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase; letter-spacing: 3px; color: #a7a292; }
body.tv .tiles { overflow: hidden; margin: 0 -10px; }
body.tv .tile { float: left; width: 23%; margin: 0 1% 20px; min-height: 150px; padding: 24px; border-radius: 18px;
  background: #282b25; border: 2px solid #33362f; cursor: pointer; }
body.tv .tile .label { font-family: Georgia, serif; font-size: 34px; line-height: 1.15; }
body.tv .tile .state { font-size: 20px; margin-top: 10px; color: #a7a292; text-transform: uppercase; letter-spacing: 1.5px; }
body.tv .tile.on { background: #3d6149; border-color: #3d6149; }
body.tv .tile.on .state { color: #cfe0d2; }
body.tv .tile.sensor { background: transparent; cursor: default; }
body.tv .tile.sensor .state { font-family: Georgia, serif; font-size: 40px; color: #f3eee4; text-transform: none; letter-spacing: 0; }
body.tv .tile.busy { opacity: 0.5; }
body.tv .tile.focus { border-color: #e2a66c; background-color: #34372f; }
body.tv .tile.on.focus { background-color: #4a7357; }
body.tv .login { padding-top: 200px; max-width: 600px; }
body.tv .login h1 { font-size: 64px; }
body.tv .login input, body.tv .login button { font-size: 34px; }

/* ---- admin tabs ------------------------------------------------------------- */
.tabs { float: left; margin: 4px 0 0 28px; }
.tabs a { display: inline-block; margin-right: 6px; padding: 5px 14px; border-radius: 18px;
  color: #5f5c52; text-decoration: none; font-size: 15px; }
.tabs a.active { background: #2e4a39; color: #fbf8f1; }
.device.link { display: block; padding-left: 52px; color: #2e4a39; text-decoration: none; font-size: 15px; line-height: 26px; }

/* ---- music view ------------------------------------------------------------- */
.music { padding-top: 24px; }
.music-note { padding: 28px; border-radius: 18px; background: #fbf8f1; border: 1px solid #e2dacb; max-width: 560px; }
.music-note h2 { margin: 0; font-size: 28px; }
.music-note p { margin: 8px 0 0; color: #5f5c52; }
.music-note .connect { display: inline-block; margin-top: 18px; padding: 12px 22px; border-radius: 24px;
  background: #2e4a39; color: #fbf8f1; text-decoration: none; }
.music.off .np, .music.off .speakers, .music.off .music-search, .music.off #music-results, .music.off #music-msg, .music.off #music-sample { display: none; }
.music-sample { margin: 0 0 12px; font-size: 13px; color: #7b776a; }
.music-msg { margin: 4px 0 0; padding: 10px 14px; border-radius: 10px; background: #f7e3dc; color: #a5402a; font-size: 14px; }
.art { position: relative; overflow: hidden; background: #dfe7d9; color: #fbf8f1; text-align: center; }
.art img { display: block; width: 100%; height: 100%; }
.art-letter { font-family: Georgia, serif; }

.np { background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 18px; padding: 22px; overflow: hidden; }
.np-art { float: left; width: 220px; height: 220px; }
.art-lg { width: 220px; height: 220px; border-radius: 12px; }
.art-lg .art-letter { font-size: 96px; line-height: 220px; }
.np-body { margin-left: 250px; padding-top: 4px; }
.np-where { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: #b06f45; }
.np-title { margin: 8px 0 0; font-size: 34px; line-height: 1.15; }
.np-sub { margin: 6px 0 0; color: #7b776a; font-size: 16px; }
.np-controls { margin-top: 22px; }
.np-btn { display: inline-block; vertical-align: middle; width: 52px; height: 52px; margin-right: 10px; padding: 0;
  border: 1px solid #e2dacb; border-radius: 26px; background: #fbf8f1; color: #2e4a39; cursor: pointer; -webkit-appearance: none; }
.np-btn .ic { width: 26px; height: 26px; color: inherit; }
.np-main { width: 68px; height: 68px; border-radius: 34px; border: 0; background: #2e4a39; color: #fbf8f1; }
.np-main .ic { width: 30px; height: 30px; }
.np-vol { margin-top: 20px; max-width: 360px; }
.np-vol .ic { color: #7b776a; margin-right: 10px; }
.np-vol input { vertical-align: middle; width: 280px; }

.speakers { margin-top: 14px; }
.speaker { display: inline-block; margin: 0 8px 8px 0; padding: 8px 14px 8px 10px; border: 1px solid #e2dacb;
  border-radius: 22px; background: #fbf8f1; color: #23261f; font-size: 15px; cursor: pointer; -webkit-appearance: none; }
.speaker .ic { width: 20px; height: 20px; margin-right: 6px; color: #9a968a; }
.speaker.on { background: #2e4a39; border-color: #2e4a39; color: #fbf8f1; }
.speaker.on .ic { color: #cfe0d2; }

.music-search { position: relative; margin-top: 22px; }
.music-search .ic { position: absolute; left: 16px; top: 14px; width: 20px; height: 20px; color: #7b776a; }
.music-search input { width: 100%; padding: 13px 16px 13px 46px; font-size: 17px; border: 1px solid #e2dacb;
  border-radius: 26px; background: #fbf8f1; color: #23261f; -webkit-appearance: none; }
.music-h { margin: 26px 0 10px; font-size: 20px; }
.music-empty { color: #7b776a; margin-top: 24px; }

.tracks { background: #fbf8f1; border: 1px solid #e2dacb; border-radius: 14px; }
.track { position: relative; padding: 10px 56px 10px 76px; min-height: 68px; border-top: 1px solid #ece5d8; cursor: pointer; }
.track:first-child { border-top: 0; }
.art-sm { position: absolute; left: 12px; top: 10px; width: 48px; height: 48px; border-radius: 6px; }
.art-sm .art-letter { font-size: 22px; line-height: 48px; }
.track-title { font-size: 16px; padding-top: 3px; }
.track-sub { font-size: 14px; color: #7b776a; }
.track-play { position: absolute; right: 18px; top: 22px; color: #2e4a39; }
.track-play .ic { width: 18px; height: 18px; color: inherit; }

.covers { overflow: hidden; margin: 0 -6px; }
.cover { float: left; width: 16.66%; padding: 0 6px 14px; cursor: pointer; }
.art-sq { width: 100%; height: 0; padding-bottom: 100%; border-radius: 10px; }
.art-sq img { position: absolute; left: 0; top: 0; }
.art-sq .art-letter { position: absolute; left: 0; right: 0; top: 50%; margin-top: -24px; font-size: 40px; line-height: 48px; }
.cover-title { margin-top: 8px; font-size: 15px; line-height: 1.25; }
.cover-sub { font-size: 13px; color: #7b776a; }

@media (max-width: 899px) {
  .cover { width: 25%; }
}
@media (max-width: 640px) {
  .tabs { float: none; clear: both; margin: 12px 0 0; }
  .masthead-right #clock { display: none; }
  .np { padding: 16px; }
  .np-art { float: none; width: 100%; height: auto; }
  .art-lg { width: 100%; height: 0; padding-bottom: 100%; }
  .art-lg img { position: absolute; left: 0; top: 0; }
  .art-lg .art-letter { position: absolute; left: 0; right: 0; top: 50%; margin-top: -60px; line-height: 120px; }
  .np-body { margin: 16px 0 0; text-align: center; }
  .np-title { font-size: 26px; }
  .np-vol { margin: 18px auto 0; }
  .np-vol input { width: 230px; }
  .cover { width: 50%; }
}
.np-vol input[type=range] { -webkit-appearance: none; height: 4px; border-radius: 2px; background: #d8d1c2; outline: none; margin: 0; }
.np-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 11px;
  background: #2e4a39; border: 3px solid #fbf8f1; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.np-vol input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 9px; background: #2e4a39; border: 3px solid #fbf8f1; }

/* ---- shared iPad welcome: guest access / admin ------------------------------- */
.choose { margin-top: 10px; }
.login .big { display: block; width: 100%; font-size: 21px; padding: 18px; border: 0; border-radius: 30px;
  background: #2e4a39; color: #fbf8f1; -webkit-appearance: none; cursor: pointer; }
.login .quiet { display: inline-block; margin-top: 22px; color: #7b776a; text-decoration: none;
  border-bottom: 1px solid #d8d1c2; font-size: 15px; }
.prompt { margin: 0 0 10px; color: #5f5c52; }
#login-input[readonly] { letter-spacing: 8px; }
.login .keypad { overflow: hidden; margin: 4px -5px 14px; }
.login .key { float: left; width: 33.333%; height: 64px; margin: 0; padding: 0; line-height: 54px; border: 5px solid #f3eee4; border-radius: 16px;
  background: #fbf8f1; color: #23261f; font-size: 26px; font-family: Georgia, "Times New Roman", serif;
  -webkit-appearance: none; cursor: pointer; }
.login .key:active { background: #dfe7d9; }
.login .key.blank { background: transparent; cursor: default; }
.login .key.del { font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 22px; color: #7b776a; }
.shared-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #dfe7d9; color: #2e4a39; font-size: 14px; }
.device.alert { background: #f7e3dc; }
.device.alert .device-v, .device.alert > .ic { color: #a5402a; }
.devices.wide { overflow: hidden; }
.devices.wide .room-col { float: left; width: 49%; }
.devices.wide .room-col + .room-col { float: right; }
@media (max-width: 640px) { .devices.wide .room-col { float: none; width: auto; } }
