.time-search { display: grid; gap: 6px; }
.time-search input { width: 100%; }
.zone-message { min-height: 1.2em; margin: 0; color: var(--red); font-size: .8rem; }
.control-grid { grid-template-columns: minmax(260px, 1.35fr) minmax(180px, .85fr) minmax(180px, .85fr) auto; }
.control-grid > .field { min-width: 0; }
#add-zone { min-width: 84px; }

.page { grid-template-columns: minmax(0, 1fr); }
.tool-resources { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.35fr); gap: 32px; align-items: end; margin-bottom: 48px; padding: 28px 0 6px; border-top: 1px solid var(--line); }
.tool-resources__intro .eyebrow { margin-bottom: 6px; color: var(--green-dark); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tool-resources__intro h2 { margin: 0; color: var(--text); font-size: 1.2rem; line-height: 1.2; }
.tool-resources__links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.tool-resources__links a { display: grid; gap: 7px; min-height: 78px; padding: 14px 16px; border-right: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background .2s ease, color .2s ease; }
.tool-resources__links a:first-child { border-left: 1px solid var(--line); }
.tool-resources__links a:hover, .tool-resources__links a:focus-visible { background: color-mix(in srgb, var(--green) 7%, var(--page)); color: var(--green-dark); text-decoration: none; }
.tool-resources__links span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.tool-resources__links strong { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; line-height: 1.2; }
.tool-resources__links b { color: var(--green); font-size: 1.05rem; transition: transform .2s ease; }
.tool-resources__links a:hover b, .tool-resources__links a:focus-visible b { transform: translateX(3px); }

.timeline-wrap { scroll-padding-left: 176px; }
.timeline { min-width: 900px; gap: 7px; }
.time-row { grid-template-columns: 168px repeat(24, 1fr); gap: 4px; }
.hour small { display: none; }
.time-row > :first-child { position: sticky; left: 0; z-index: 2; box-shadow: 10px 0 14px color-mix(in srgb, var(--page) 93%, transparent); }
.tz-label { position: relative; min-height: 62px; padding: 9px 40px 9px 10px; border-radius: 10px; }
.tz-label[draggable="true"] { cursor: grab; transition: border-color .2s ease, background .2s ease, opacity .2s ease; }
.tz-label[draggable="true"]:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.tz-label.is-dragging { cursor: grabbing; opacity: .45; }
.tz-label.is-drop-target { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }
.tz-label strong { font-size: .86rem; line-height: 1.15; }
.zone-meta { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.zone-remove { position: absolute; top: 8px; right: 8px; display: inline-grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease; }
.zone-remove svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.zone-remove:hover, .zone-remove:focus-visible { background: color-mix(in srgb, var(--red) 10%, var(--surface)); color: var(--red); }
.zone-remove:active { transform: scale(.94); }

.hour { min-height: 62px; padding: 5px 2px; border-radius: 8px; font-size: .75rem; }
.hour.night { background: color-mix(in srgb, var(--surface-2) 91%, #24344e); color: var(--text-faint); }
.hour.work { background: color-mix(in srgb, var(--green) 8%, var(--surface)); border-color: color-mix(in srgb, var(--green) 34%, var(--line)); }
.hour.day-shift { position: relative; border-left: 2px solid var(--orange); }
.hour.day-shift::after { content: attr(data-day); position: absolute; right: 3px; bottom: 3px; color: var(--muted); font-size: .58rem; line-height: 1; }
.hour.selected { z-index: 1; background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent); }
.hour.selected small { color: rgba(255,255,255,.84); }

.event-builder { display: grid; grid-template-columns: minmax(180px, 1fr) 130px auto; gap: 10px; align-items: end; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.event-builder .field { margin: 0; }
.event-builder .input, .event-builder .select { height: 42px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .event-builder { padding-left: 24px; padding-right: 24px; }
  .tool-resources { grid-template-columns: 1fr; gap: 16px; }
  .control-grid { grid-template-columns: 1fr 1fr auto; }
  .control-grid > .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .event-builder { padding: 16px 14px; }
  .event-builder { grid-template-columns: 1fr 1fr; }
  .event-builder .field:first-child, .event-builder .btn { grid-column: 1 / -1; }
  .control-grid { grid-template-columns: 1fr; }
  .control-grid > .field:first-child { grid-column: auto; }
  #add-zone { width: 100%; }
  .timeline-wrap { padding-left: 14px; padding-right: 14px; }
  .timeline { min-width: 770px; }
  .time-row { grid-template-columns: 142px repeat(24, 1fr); }
  .tz-label { padding: 8px; }
  .tool-resources { margin-bottom: 32px; padding-top: 22px; }
  .tool-resources__links { grid-template-columns: 1fr; border-bottom: 1px solid var(--line); }
  .tool-resources__links a { min-height: 62px; border: 0; border-top: 1px solid var(--line); }
  .tool-resources__links a:first-child { border-left: 0; border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hour { transition: none; }
}
