/* Lumio на телефоне: графит, монохром, мелкий аккуратный шрифт — как островок на Mac. */
:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.1);
  --hairline: rgba(255, 255, 255, 0.09);
  --primary: rgba(255, 255, 255, 0.92);
  --secondary: rgba(255, 255, 255, 0.52);
  --tertiary: rgba(255, 255, 255, 0.3);
  --accent: #dcdfe8;
  --sage: #8fbf9c;
  --alert: #e0877e;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--primary);
  font: 14px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }

/* «Островок» сверху: чёрная капсула со сводкой. */
.top {
  position: sticky; top: 0; z-index: 5;
  padding: calc(env(safe-area-inset-top) + 8px) 0 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
  display: flex; justify-content: center;
}
.island {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 0 16px; border-radius: 17px;
  background: #000; color: var(--primary); border: 0;
  box-shadow: 0 0 0 1px var(--hairline);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
}
.island .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tertiary); }
.island .dot.working { background: var(--sage); }
.island .dot.waiting { background: var(--accent); animation: breathe 1.4s ease-in-out infinite; }

@keyframes breathe { 50% { opacity: 0.35; } }

.banner {
  margin: 4px 0 12px; padding: 10px 14px; border-radius: 14px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--secondary); font-size: 13px;
}

h2 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--secondary); letter-spacing: 0.02em; }

.card {
  background: var(--card); border-radius: 18px; padding: 14px;
  box-shadow: inset 0 0 0 1px var(--hairline); margin-bottom: 12px;
}

/* Кто ждёт — белая карточка, как белая плашка «ждёт вас» в офисе. */
.wait {
  background: #f2f3f5; color: #111; border-radius: 18px; padding: 14px; margin-bottom: 12px;
}
.wait .name { font-weight: 700; font-size: 15px; }
.wait .what { margin: 4px 0 12px; color: #444; font-size: 13px; }
.wait .row-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wait .since { color: #666; font-size: 12px; white-space: nowrap; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border-radius: 12px; text-decoration: none;
  font-weight: 600; font-size: 14px;
  background: var(--card-strong); color: var(--primary);
}
.wait .btn { background: #111; color: #fff; }
.btn.off { opacity: 0.45; pointer-events: none; }

/* Список людей. */
details.person { border-top: 1px solid var(--hairline); }
details.person:first-child { border-top: 0; }
details.person summary {
  list-style: none; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px;
  padding: 10px 2px; cursor: pointer;
}
details.person summary::-webkit-details-marker { display: none; }
.state { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); }
.state.working { background: var(--sage); }
.state.waiting { background: var(--accent); }
.state.failed { background: var(--alert); }
.who { min-width: 0; }
.who .name { font-weight: 600; }
.who .label { color: var(--secondary); margin-left: 6px; }
.who .name, .who .label { white-space: nowrap; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { color: var(--tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }

.more { padding: 0 2px 12px 20px; color: var(--secondary); font-size: 13px; }
.more p { margin: 0 0 8px; }
.more .k { color: var(--tertiary); font-size: 11px; display: block; margin-bottom: 1px; }
.more .v { color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.chip { padding: 3px 8px; border-radius: 8px; background: var(--card-strong); font-size: 11.5px; color: var(--primary); }

.empty { color: var(--secondary); font-size: 13px; padding: 6px 2px; }

/* Лимиты и итоги дня. */
.grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.meter { margin: 0 0 12px; }
.meter:last-child { margin-bottom: 0; }
.meter .line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.meter .pct { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.meter .pct.hot { color: var(--alert); }
.meter .sub, .sub { color: var(--tertiary); font-size: 12px; margin: 6px 0 0; }
.bar { height: 5px; border-radius: 3px; background: var(--card-strong); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--sage); }
.bar i.hot { background: var(--alert); }

.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big small { font-size: 13px; font-weight: 500; color: var(--secondary); margin-left: 6px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin: 12px 0 6px; }
.chart i { flex: 1; border-radius: 2px 2px 0 0; background: rgba(255, 255, 255, 0.28); min-height: 2px; }
.chart i.zero { background: rgba(255, 255, 255, 0.07); }
.chart i.now { background: var(--sage); }
.ticks { display: flex; justify-content: space-between; color: var(--tertiary); font-size: 10px; }
.projects { margin-top: 10px; color: var(--secondary); font-size: 12.5px; }
.projects div { display: flex; justify-content: space-between; padding: 3px 0; }
.projects b { color: var(--primary); font-weight: 500; }

/* Пиксельный офис: во всю ширину карточки, по нажатию — крупнее, с прокруткой вбок. */
.office-card { padding: 8px; }
.office-box { overflow-x: auto; overflow-y: hidden; border-radius: 12px; background: #0e0f11;
              -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.office-box::-webkit-scrollbar { display: none; }
#office { display: block; image-rendering: pixelated; touch-action: pan-x pan-y; }
.hint { margin: 6px 4px 0; color: var(--tertiary); font-size: 11px; text-align: center; }
details.person.flash summary { animation: flash 1.2s ease-out; border-radius: 10px; }
@keyframes flash { 0% { background: rgba(255,255,255,0.14); } 100% { background: transparent; } }

.notify { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify b { font-size: 14px; }
.notify p { margin: 2px 0 0; }
.btn.small { height: 34px; padding: 0 14px; border: 0; font-family: inherit; flex: none; background: #f2f3f5; color: #111; }

.foot { text-align: center; color: var(--tertiary); font-size: 11.5px; margin: 6px 0 0; }

.message { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 0 12px; }
.message .pill { width: 120px; height: 34px; border-radius: 17px; background: #000; margin: 0 auto 18px;
                 box-shadow: 0 0 0 1px var(--hairline); }
.message p { margin: 4px 0; }
.dim { color: var(--secondary); font-size: 13px; }

@media (min-width: 700px) {
  body { max-width: 720px; margin: 0 auto; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

[hidden] { display: none !important; }

/* Телефон боком: офис слева во всю высоту экрана (не обрезается), карточки справа. */
@media (orientation: landscape) and (max-height: 560px) {
  body { max-width: none; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  #app:has(#office-card:not([hidden])) {
    display: grid; grid-template-columns: min(var(--office-w, 60%), 62%) minmax(0, 1fr); column-gap: 12px; align-items: start;
  }
  #app:has(#office-card:not([hidden])) > * { grid-column: 2; }
  #app:has(#office-card:not([hidden])) > #office-card {
    grid-column: 1; grid-row: 1 / span 30; position: sticky; top: calc(env(safe-area-inset-top) + 52px);
  }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .hint { display: none; }
}

/* Кнопка музыки — в углу офиса. */
.office-card { position: relative; }
.sound {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 15px; border: 0; padding: 5px;
  background: rgba(10, 11, 13, 0.62); color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px var(--hairline);
}
.sound svg { width: 20px; height: 20px; display: block; }
.sound .off, .sound.muted .on { display: none; }
.sound.muted .off { display: inline; }
.sound.muted { color: rgba(255, 255, 255, 0.5); }

/* Настройки: строки с переключателями в стиле iOS, только монохром. */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0;
          border-top: 1px solid var(--hairline); cursor: pointer; }
.settings h2 + .toggle { border-top: 0; padding-top: 2px; }
.toggle span { font-size: 14px; }
.toggle small { display: block; color: var(--tertiary); font-size: 11.5px; margin-top: 1px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--card-strong); position: relative;
            transition: background 0.2s ease; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
                   background: #d8d9dc; transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.4, 1); }
.toggle input:checked + i { background: var(--sage); }
.toggle input:checked + i::after { transform: translateX(16px); background: #fff; }
