:root {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", sans-serif;
  color: #191d20;
  background: #f6f6f7;
  --muted: #606469;
  --line: #e4e5e7;
  --accent: #176247;
  --pale: #e9f4ed;
}
[hidden] { display: none !important; }
.manager { width: min(calc(100% - 48px), 1080px); margin: 28px auto 54px; }
.page-header, .view-bar, #date-controls, .editor-head, .editor-actions, .report-head,
.slot-tools, .slot-card-head, .progress-context, .progress-heading, .progress-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.page-header { margin-bottom: 16px; }
.page-header h1 { margin: 4px 0 0; font-size: clamp(27px, 4vw, 37px); letter-spacing: -.04em; }
.manager .switcher { background: #edeef0; }
.manager button { border-color: #d9dbde; }
.manager button.primary { border-color: var(--accent); }
.identity, .hint { color: var(--muted); font-size: 13px; }
.identity { position: relative; }
.identity summary {
  display: grid; place-items: center; min-height: 44px; padding: 0 12px;
  list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.identity summary::-webkit-details-marker { display: none; }
.account-menu {
  position: absolute; z-index: 4; right: 0; top: calc(100% + 6px);
  min-width: 144px; max-width: 65vw; padding: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 16px #191d2012;
  display: grid; gap: 8px; overflow-wrap: anywhere;
}
.hint { line-height: 1.5; }
h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.login { display: grid; gap: 14px; max-width: 400px; padding: 22px; }
.login label { display: grid; gap: 6px; font-size: 14px; }
.login .hint { margin: 0; }
.saved-identity { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.saved-identity span { overflow-wrap: anywhere; }
.manager input, .manager select {
  color: inherit; font: inherit; font-size: 16px; background: #fff; border: 1px solid #c9ccd0;
  border-radius: 8px; min-height: 42px; padding: 6px 9px; min-width: 0;
}
.manager button, .manager .switcher button { min-height: 44px; }
.manager :is(input, select, button, summary, [tabindex]):focus-visible { outline: 2px solid #287761; outline-offset: 2px; }
.slot-tools { flex-wrap: wrap; gap: 6px 10px; margin: 12px 0 10px; }
.slot-tools label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
#slot-share .actions { margin-top: 12px; }
#share-text {
  box-sizing: border-box; display: block; width: 100%; padding: 10px;
  color: inherit; font: inherit; font-size: 16px; line-height: 1.55;
  font-variant-numeric: tabular-nums; background: #f6f6f7;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
#share-status:not(:empty) { margin: 8px 0 0; }
.slot-targets, .slot-progress { padding: 22px 25px; margin-bottom: 12px; }
.slot-card-head { align-items: flex-start; flex-wrap: wrap; }
.slot-caption { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
#target-title { font-size: clamp(28px, 4.2vw, 40px); font-weight: 750; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.peak-hour {
  background: #fce7dd; color: #903912; padding: 5px 10px; border-radius: 20px;
  font-size: 13px; font-weight: 650; white-space: nowrap;
}
.target-metrics { display: grid; gap: 8px; margin: 16px 0 0; }
.product-targets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.group-targets { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 15px; }
.target-metrics dt { font-size: clamp(12px, 2vw, 16px); color: var(--muted); }
.target-metrics dd {
  margin: 4px 0 0; font-size: clamp(27px, 5.5vw, 46px); font-weight: 750;
  letter-spacing: -.035em; line-height: 1.07; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.group-targets > div:nth-child(n+2) dd { color: #08633a; }
.target-metrics .device-detail {
  margin-top: 6px; font-size: 12px; font-weight: 550; line-height: 1.35;
  letter-spacing: normal; color: var(--muted);
}
.target-metrics .device-detail.short { color: #944117; }
.slot-progress > .slot-card-head { align-items: center; }
.progress-switcher button { white-space: nowrap; padding-inline: 10px; }
.progress-context { flex-wrap: wrap; gap: 1px 9px; margin-top: 8px; }
#open-missing { padding: 0; }
#slot-clock { margin: 0; font-variant-numeric: tabular-nums; }
#slot-progress-rows { display: grid; gap: 15px; margin-top: 16px; }
.progress-row { --bar-color: #258b65; }
.progress-row.behind { --bar-color: #d87738; }
.progress-heading, .progress-meta { font-variant-numeric: tabular-nums; }
.progress-heading h3 { font-size: 16px; margin: 0; }
.progress-heading > span { font-weight: 650; }
.progress-meta { color: var(--muted); font-size: 13px; }
.progress-meta { flex-wrap: wrap; gap: 4px 12px; }
.attach-detail { margin: 4px 0 0; }
.behind .progress-gap { color: #9b4319; }
.slot-bar {
  appearance: none; display: block; width: 100%; height: 9px; border: 0;
  border-radius: 9px; overflow: hidden; margin: 6px 0 5px; background: #edeeef; color: var(--bar-color);
}
.slot-bar::-webkit-progress-bar { background: #edeeef; border-radius: 9px; }
.slot-bar::-webkit-progress-value { background: var(--bar-color); border-radius: 9px; }
.slot-bar::-moz-progress-bar { background: var(--bar-color); border-radius: 9px; }
.daily-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr); gap: 12px; }
.summary, .editor { padding: 19px; }
#editor-title { scroll-margin-top: 16px; }
.editor { min-width: 0; }
.editor-head {
  position: sticky; top: 0; z-index: 2; background: #fff; padding: 8px 0;
  flex-wrap: wrap; gap: 4px 12px;
}
#edit-context { margin-top: 4px; }
#entry-availability { color: #944117; }
#current-hour { margin: 0 0 8px; padding-inline: 0; }
#device-total { font-size: clamp(26px, 4vw, 34px); font-weight: 750; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
#device-progress { margin: 0 0 12px; }
#daily-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; margin: 0; }
#daily-metrics dt { font-size: 12px; color: var(--muted); }
#daily-metrics dd { font-weight: 700; font-variant-numeric: tabular-nums; margin: 3px 0 0; }
.drop-in { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 12px; color: var(--muted); font-size: 13px; }
.drop-in summary { cursor: pointer; padding: 7px 0; }
#overall { margin: 2px 0 0; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.entry { min-width: 0; display: grid; gap: 4px; padding: 8px; background: #f5f6f7; border-radius: 10px; }
.entry label { font-weight: 700; font-size: 13px; }
.entry .hint { margin: 0; font-variant-numeric: tabular-nums; }
.entry input { width: 100%; }
.entry input[aria-invalid="true"] { border-color: #a13627; }
.status { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.status:empty { display: none; }
#sync:not(:empty) { margin: 8px 0; }
.status[data-error="true"] { color: #a13627; }
.editor-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#save-message:not(:empty) { margin-top: 8px; }
#conflicts { font-size: 14px; background: #fff4dc; border-radius: 8px; padding: 10px; margin-top: 12px; }
#conflict-list { margin: 0 0 8px; padding-left: 20px; }
.report { margin-top: 14px; padding: 16px; }
.report h2 { margin-bottom: 12px; }
.report-head h2 { margin: 0; }
.report-head { margin-bottom: 12px; flex-wrap: wrap; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.manager table { border-collapse: separate; border-spacing: 0; min-width: 720px; }
.manager th:first-child { width: 132px; position: sticky; left: 0; z-index: 1; padding-left: 8px; background: #fff; }
.manager thead th:first-child { background: #f5f7f5; }
.manager td { font-size: 14px; }
.manager #week-table th:nth-child(2), .manager #week-table th:last-child { width: 130px; }
.manager #day-table th:last-child { width: 108px; }
#week-cards { display: none; }
.manager tbody .current > * { background: #eef6ef; }
.manager tfoot :is(th, td) { background: #f5f7f5 !important; padding: 8px 4px; text-align: center; }
.manager tfoot th { text-align: left; }
.manager :is(tbody, tfoot) small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.row-button { background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; padding-inline: 4px; }
.row-button[aria-current="true"] { color: var(--accent); background: var(--pale); }
.peak-mark { font-size: 11px; border-radius: 4px; padding: 1px 3px; background: #f7e9c6; color: #634710; margin-left: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  .manager { width: calc(100% - 24px); margin-top: 14px; }
  .page-header { margin-bottom: 9px; }
  .view-bar { flex-wrap: wrap; gap: 6px; }
  .slot-tools { margin-top: 8px; }
  .slot-targets, .slot-progress { padding: 15px; margin-bottom: 8px; }
  .target-metrics { margin-top: 12px; }
  .group-targets { padding-top: 12px; }
  #slot-progress-rows { margin-top: 12px; gap: 11px; }
  .daily-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .summary, .editor, .report { padding: 12px; }
  .report { margin-top: 8px; }
  .week-table-wrap { display: none; }
  #week-cards { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
  .week-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; width: 100%; text-align: left; }
  .week-day .hint { grid-column: 1 / -1; }
}
@media (max-width: 370px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
