/* Página inicial: saudação, IA, atalhos e próximo plantão. */
.home { max-width: 760px; margin: 0 auto; padding: 56px 24px 72px; }
.home .icon { width: 20px; height: 20px; }

.home-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.home-date { margin: 0 0 6px; color: var(--muted); font-size: calc(14px * var(--pelison-type-scale, 1)); }
.home-date::first-letter { text-transform: uppercase; }
.home-hello h1 { margin: 0; font-size: calc(32px * var(--pelison-type-scale, 1)); font-weight: 680; letter-spacing: -.025em; line-height: 1.15; }
.home-settings { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--muted); flex-shrink: 0; transition: color .15s, border-color .15s, transform .3s; }
.home-settings:hover { color: var(--blue); border-color: var(--blue); transform: rotate(30deg); }

/* IA em destaque, com o mesmo degradê do item "IA" do cabeçalho. */
.home-ai { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 14px; padding: 20px 22px; border-radius: 20px; overflow: hidden; color: #fff; text-decoration: none; background: linear-gradient(120deg, #2567db 0%, #5b5ff0 55%, #8b5cf6 100%); box-shadow: 0 10px 30px #4f5de633; transition: transform .15s, box-shadow .15s; }
.home-ai[hidden] { display: none; }
.home-ai::after { content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #ffffff2e, transparent 70%); pointer-events: none; }
.home-ai:hover { transform: translateY(-2px); box-shadow: 0 14px 36px #4f5de640; }
.home-ai-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #ffffff26; flex-shrink: 0; }
.home-ai-icon .icon { width: 24px; height: 24px; }
.home-ai-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.home-ai-text strong { font-size: calc(18px * var(--pelison-type-scale, 1)); font-weight: 680; }
.home-ai-text span { font-size: calc(14px * var(--pelison-type-scale, 1)); opacity: .85; }
.home-ai-go { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #ffffff26; transition: transform .15s; }
.home-ai:hover .home-ai-go { transform: translateX(3px); }

.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 118px; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--sheet-shadow); color: var(--text); text-decoration: none; font-weight: 620; font-size: calc(16px * var(--pelison-type-scale, 1)); transition: border-color .15s, transform .15s, box-shadow .15s; }
.home-tile:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 10px 26px #2567db17; }
.home-tile-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); transition: background .15s, color .15s; }
.home-tile:hover .home-tile-icon { background: var(--blue); color: var(--surface); }
:is(.home-tile, .home-ai, .home-shift, .home-settings):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.home-shift { --shift: var(--blue); display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 16px 18px 16px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--sheet-shadow); transition: border-color .15s; }
.home-shift[hidden] { display: none; }
.home-shift:hover { border-color: var(--shift); }
.home-shift-badge { display: grid; place-items: center; align-content: center; width: 58px; height: 62px; border-radius: 14px; background: color-mix(in srgb, var(--shift) 14%, transparent); color: var(--shift); flex-shrink: 0; }
.home-shift-badge.home-shift-empty { background: var(--surface-soft); color: var(--muted); }
.home-shift-month { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.home-shift-day { font-size: 24px; font-weight: 720; line-height: 1.05; }
.home-shift-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.home-shift-text strong { font-size: calc(16px * var(--pelison-type-scale, 1)); font-weight: 650; }
.home-shift-text span { color: var(--muted); font-size: calc(14px * var(--pelison-type-scale, 1)); }
.home-shift-text .home-shift-place { display: flex; align-items: center; gap: 6px; }
.home-shift-text .home-shift-place::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--shift); }
.home-shift-go { color: var(--muted); display: grid; transition: transform .15s, color .15s; }
.home-shift:hover .home-shift-go { color: var(--shift); transform: translateX(3px); }

@media (max-width: 640px) {
  .home { padding: 28px 16px 56px; }
  .home-hello { margin-bottom: 22px; }
  .home-hello h1 { font-size: calc(26px * var(--pelison-type-scale, 1)); }
  .home-ai { padding: 16px 18px; border-radius: 18px; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-tile { min-height: 104px; padding: 15px; gap: 14px; border-radius: 16px; }
  .home-shift { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { .home * { transition: none !important; } }

/* Painel de plantão */
.home-duty { margin-top: 40px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.home-section-head h2 { margin: 0; font-size: calc(20px * var(--pelison-type-scale, 1)); font-weight: 680; letter-spacing: -.01em; }
.home-edit { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: calc(14px * var(--pelison-type-scale, 1)); font-weight: 560; cursor: pointer; transition: border-color .15s, color .15s; }
.home-edit .icon { width: 16px; height: 16px; }
.home-edit:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.home-edit:disabled { opacity: .5; cursor: default; }

.home-libs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.home-lib { --tone: var(--blue); display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: calc(14px * var(--pelison-type-scale, 1)); line-height: 1.25; transition: border-color .15s, transform .15s; }
.home-lib[data-color="red"] { --tone: #e5484d; }
.home-lib[data-color="purple"] { --tone: #8b5cf6; }
.home-lib[data-color="teal"] { --tone: #12a594; }
.home-lib:hover { border-color: var(--tone); transform: translateY(-2px); }
.home-lib-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); }
.home-lib-icon .icon { width: 18px; height: 18px; }

.home-pins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-pin, .home-organizer-row { --tone: var(--blue); display: flex; align-items: center; gap: 12px; min-width: 0; }
.home-pin { padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s; }
.home-pin:hover { border-color: var(--tone); }
:is(.home-pin, .home-organizer-row)[data-kind="medicine"] { --tone: #12a594; }
:is(.home-pin, .home-organizer-row)[data-kind="flow"] { --tone: #8b5cf6; }
:is(.home-pin, .home-organizer-row)[data-kind="guidance"] { --tone: #e5803b; }
:is(.home-pin, .home-organizer-row)[data-kind="heart"] { --tone: #e5484d; }
.home-pin-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 13%, transparent); color: var(--tone); flex-shrink: 0; }
.home-pin-icon .icon { width: 18px; height: 18px; }
.home-pin-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.home-pin-title { font-weight: 600; font-size: calc(15px * var(--pelison-type-scale, 1)); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.home-pin-meta { color: var(--muted); font-size: calc(12.5px * var(--pelison-type-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-pin-go { display: grid; color: var(--muted); transition: transform .15s, color .15s; }
.home-pin-go .icon { width: 18px; height: 18px; }
.home-pin:hover .home-pin-go { color: var(--tone); transform: translateX(2px); }
.home-pin-skeleton { height: 62px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-soft) 50%, var(--surface) 100%); background-size: 200% 100%; animation: home-shimmer 1.2s infinite linear; }
@keyframes home-shimmer { to { background-position: -200% 0; } }
.home-pins-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; border: 1.5px dashed var(--border); border-radius: 14px; background: transparent; color: var(--muted); font: inherit; font-weight: 560; cursor: pointer; }
.home-pins-empty:hover { border-color: var(--blue); color: var(--blue); }
.home-duty-error { color: var(--danger); font-size: 14px; }

/* Janela "Organizar painel": central no computador, de baixo para cima no celular. */
.home-organizer { width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px #0003; overflow: hidden; display: flex; flex-direction: column; }
.home-organizer:not([open]) { display: none; }
.home-organizer::backdrop { background: #0b1220a6; backdrop-filter: blur(2px); }
.home-organizer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px 22px; border-bottom: 1px solid var(--border); }
.home-organizer-head h2 { margin: 0; font-size: 18px; font-weight: 680; }
.home-organizer-body { padding: 16px 22px 22px; overflow-y: auto; }
.home-organizer-body h3 { margin: 20px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.home-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-soft); font-weight: 560; cursor: pointer; }
.home-switch input { appearance: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: background .15s; flex-shrink: 0; }
.home-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
.home-switch input:checked { background: var(--blue); }
.home-switch input:checked::after { transform: translateX(18px); }
.home-organizer-list { display: grid; gap: 6px; }
.home-organizer-row { padding: 8px 8px 8px 10px; border-radius: 12px; border: 1px solid var(--border); }
.home-organizer-empty { margin: 4px 0; color: var(--muted); font-size: 14px; }
.home-icon-button, .home-add { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.home-icon-button .icon, .home-add .icon { width: 17px; height: 17px; }
.home-icon-button:hover:not(:disabled) { background: var(--surface-soft); color: var(--text); }
.home-icon-button:disabled { opacity: .3; cursor: default; }
.home-add { background: var(--blue-soft); color: var(--blue); }
.home-add[aria-pressed="true"] { background: var(--blue); color: var(--surface); }
.home-search { display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); }
.home-search:focus-within { border-color: var(--blue); }
.home-search input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: transparent; color: var(--text); font: inherit; box-shadow: none !important; outline: none; }
.home-pills { display: flex; gap: 6px; margin: 10px 0 12px; }
.home-pill { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; }
.home-pill[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

@media (max-width: 640px) {
  .home-duty { margin-top: 32px; }
  .home-libs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-pins { grid-template-columns: 1fr; }
  .home-organizer { width: 100vw; max-width: 100vw; max-height: 88vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}
