:root {
  color-scheme: light;
  --bg: #f5f2eb;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --ink: #17211f;
  --muted: #65716e;
  --line: #ddd7cc;
  --line-strong: #c9c1b4;
  --primary: #15332f;
  --primary-soft: #e6efeb;
  --blue: #2f63b7;
  --amber: #9a5b17;
  --danger: #a9362d;
  --ok: #176b63;
  --shadow: 0 16px 38px rgba(23, 33, 31, 0.08);
  --radius: 8px;
  --gap: 12px;
  --panel-pad: 14px;
  --control-height: 46px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  word-break: keep-all;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-header,
.app-nav,
main {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 12px;
}

.header-main {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 23px;
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.status-action {
  min-height: 31px;
  border: 1px solid rgba(169, 54, 45, 0.24);
  border-radius: 999px;
  background: #f6d8d4;
  color: var(--danger);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.86);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill[hidden] {
  display: none;
}

.local-only {
  border-color: rgba(154, 91, 23, 0.3);
  color: var(--amber);
  background: #fff4e4;
}

.telegram-mode {
  border-color: rgba(47, 99, 183, 0.28);
  color: var(--blue);
  background: #edf3ff;
}

.app-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 12px;
}

.nav-button,
button,
.secondary-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 760;
}

.nav-button,
.secondary-button {
  background: #e9e4da;
  color: var(--ink);
}

.nav-button.is-active,
button[type="submit"] {
  background: var(--primary);
  color: #ffffff;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 99, 183, 0.3);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

main {
  padding-bottom: 34px;
}

.app-shell[hidden],
.access-gate[hidden] {
  display: none;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.access-gate {
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100%;
  min-height: 100svh;
  padding: 28px 0;
  background: var(--bg);
  overflow: auto;
}

.access-panel {
  display: grid;
  gap: 14px;
  width: min(100% - 28px, 520px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 22px;
  box-shadow: var(--shadow);
}

.access-form {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
}

.section-head p {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

.clean-head {
  margin: 18px 0 12px;
}

.split {
  align-items: center;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.team-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow);
}

.team-card.is-selected {
  border-color: color-mix(in srgb, var(--team-accent) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-accent) 18%, transparent), var(--shadow);
}

.team-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--team-accent) 14%, white);
  color: var(--team-accent);
  font-size: 14px;
  font-weight: 900;
}

.team-card strong {
  display: block;
  font-size: 18px;
  line-height: 44px;
}

.team-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.team-card small {
  color: var(--team-accent);
  font-weight: 800;
  line-height: 44px;
}

.meeting-form,
.filters,
.summary-strip,
.entry-list,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.meeting-form {
  padding: var(--panel-pad);
}

.login-panel {
  width: min(520px, 100%);
  margin: 34px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 18px;
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 12px;
}

.form-page-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.form-page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  background: #eee9df;
  color: var(--ink);
}

.form-page-button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(23, 33, 31, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.form-page-button.is-active {
  background: var(--primary);
  color: #ffffff;
}

.form-page-button.is-active span {
  background: rgba(255, 255, 255, 0.18);
}

.form-page {
  display: none;
  min-height: 378px;
}

.form-page.is-active {
  display: block;
}

.meta-grid,
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
}

.basic-overview {
  display: grid;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.basic-overview-head,
.basic-overview-row {
  display: grid;
  grid-template-columns: minmax(116px, 0.6fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  padding: 11px 12px;
  text-align: left;
}

.basic-overview-head {
  background: #f2eee5;
  color: var(--muted);
  font-weight: 900;
}

.basic-overview-head strong,
.basic-overview-row strong {
  justify-self: end;
  font-size: 20px;
  line-height: 1;
}

.basic-overview-row {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.basic-overview-row + .basic-overview-row {
  border-top: 1px solid var(--line);
}

.basic-overview-row span {
  color: var(--ink);
  font-weight: 900;
}

.basic-overview-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basic-overview-row:hover {
  background: #fbf8f1;
}

.filters {
  padding: var(--panel-pad);
  margin-bottom: var(--gap);
  overflow: visible;
}

.team-filter-label {
  min-width: 0;
  position: relative;
}

.team-filter-panel {
  position: relative;
  min-height: var(--control-height);
}

.team-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  text-align: left;
  box-shadow: none;
}

.team-select-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-select-arrow {
  color: var(--muted);
  font-size: 14px;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.team-filter-panel.is-open .team-select-arrow,
.team-single-select.is-open .team-select-arrow {
  transform: rotate(180deg);
}

.team-single-select {
  position: relative;
  min-height: var(--control-height);
}

.team-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 246px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 18px 42px rgba(23, 33, 31, 0.16);
}

.team-select-menu[hidden] {
  display: none;
}

.team-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 12px;
  text-align: left;
}

.team-select-option:last-child {
  border-bottom: 0;
}

.team-select-option:hover,
.team-select-option.is-selected {
  background: color-mix(in srgb, var(--team-accent, var(--primary)) 10%, white);
  color: var(--team-accent, var(--primary));
}

.option-check {
  visibility: hidden;
  color: currentColor;
  font-weight: 900;
}

.team-select-option.is-selected .option-check {
  visibility: visible;
}

label,
.field-label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label > span,
.field-label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
}

input,
select {
  min-height: var(--control-height);
}

textarea {
  min-height: 104px;
  line-height: 1.45;
  resize: vertical;
}

.form-section {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.review-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.review-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  padding: 11px 12px;
}

.review-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.review-row strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.required-note,
.optional-note {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}

.required-note {
  background: var(--primary-soft);
  color: var(--ok);
}

.optional-note {
  background: #f2eee5;
  color: var(--muted);
}

.field-stack {
  display: grid;
  gap: 10px;
}

.request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.request-field,
.item-group {
  border-left: 4px solid var(--target-accent);
  padding-left: 10px;
}

.item-group {
  display: grid;
  align-self: start;
  gap: 10px;
  padding-block: 2px 12px;
}

.item-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-group-head h3 {
  color: var(--muted);
}

.item-group-head span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eee9df;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.item-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.item-list {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.item-table-head,
.list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(64px, 88px) minmax(92px, 116px);
  align-items: center;
  gap: 0;
}

.item-table-head.has-priority,
.list-item.has-priority {
  grid-template-columns: 34px 48px minmax(0, 1fr) minmax(64px, 88px) minmax(104px, 122px);
}

.item-table-head {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: #f2eee5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.item-table-head span,
.item-cell {
  min-width: 0;
  padding: 8px 10px;
}

.item-content {
  padding-inline: 8px 12px;
}

.item-table-head span {
  border-right: 1px solid var(--line);
}

.item-table-head span:last-child {
  border-right: 0;
}

.item-table-body {
  display: grid;
}

.list-item {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item.is-pinned {
  background: #fff8df;
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
  line-height: 1;
  justify-self: center;
  text-align: center;
}

.priority-pill {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
  justify-self: center;
  padding: 0;
}

.priority-value-1 {
  background: #dfeee9;
  color: #176b63;
}

.priority-value-2 {
  background: #fff2bf;
  color: #8a6414;
}

.priority-value-3 {
  background: #f6d8d4;
  color: #9d332d;
}

.list-item-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.list-item-body p {
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.item-edit-input {
  min-height: 36px;
  padding-block: 8px;
}

.item-owner,
.detail-block li small,
.side-work-section li small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.item-owner {
  margin-top: 0;
  overflow: hidden;
}

.item-owner > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.tiny-button.is-active {
  background: var(--primary);
  color: #ffffff;
}

.repeat-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f2e6b8;
  color: #8a6414;
  font-size: 11px;
  font-weight: 900;
}

.tiny-button {
  min-width: 38px;
  min-height: 32px;
  padding: 0 9px;
  background: #eee9df;
  color: var(--ink);
  font-size: 12px;
}

.item-actions .danger-button {
  min-width: 42px;
}

.item-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.item-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.readonly-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ed;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 900;
}

.item-group.is-readonly .drag-handle {
  cursor: default;
  opacity: 0.45;
}

.empty-row {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.form-message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-ok {
  color: var(--ok);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255, 253, 250, 0), var(--surface-strong) 30%);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.team-work-toolbar,
.calendar-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
  margin-bottom: var(--gap);
}

.team-work-toolbar {
  grid-template-columns: minmax(0, 1fr);
}

.calendar-toolbar {
  grid-template-columns: auto 1fr auto;
}

.month-button {
  background: var(--primary);
  color: #ffffff;
}

.team-work-page-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.team-work-page-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  background: #eee9df;
  color: var(--ink);
  text-align: left;
}

.team-work-page-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-work-page-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(23, 33, 31, 0.08);
  font-size: 12px;
}

.team-work-page-button.is-active {
  background: var(--primary);
  color: #ffffff;
}

.team-work-page-button.is-active strong {
  background: rgba(255, 255, 255, 0.18);
}

.team-work-lists {
  display: grid;
  gap: var(--gap);
}

.team-work-lists .item-group {
  border: 1px solid var(--line);
  border-left: 4px solid var(--target-accent);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: var(--panel-pad);
  box-shadow: var(--shadow);
}

.team-work-lists .item-add-row {
  grid-template-columns: minmax(0, 1fr) auto auto 76px;
  align-items: end;
}

.team-work-lists .item-add-row > [data-action="add-item"] {
  width: 76px;
  padding-inline: 0;
}

.priority-selector {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 5px;
}

.priority-selector span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.priority-button {
  min-width: 36px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: #eee9df;
  font-size: 13px;
}

.priority-button.priority-green {
  color: #176b63;
}

.priority-button.priority-yellow {
  color: #8a6414;
}

.priority-button.priority-red {
  color: #9d332d;
}

.priority-button.priority-green.is-active {
  background: #176b63;
  color: #ffffff;
}

.priority-button.priority-yellow.is-active {
  background: #f3c746;
  color: #2b261a;
}

.priority-button.priority-red.is-active {
  background: #c44b42;
  color: #ffffff;
}

.pin-selector {
  display: grid;
  grid-template-columns: 54px;
  gap: 5px;
}

.pin-selector span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.pin-button {
  min-width: 54px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: #eee9df;
  color: var(--ink);
  font-size: 13px;
}

.pin-button.is-active {
  background: var(--primary);
  color: #ffffff;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.calendar-grid,
.calendar-side {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.calendar-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.calendar-weekdays,
.calendar-week {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.calendar-weekdays span {
  background: #eee9df;
  color: var(--muted);
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.week-report-button,
.calendar-day {
  border-radius: 0;
  background: var(--surface-strong);
  color: var(--ink);
}

.week-report-button {
  min-height: 82px;
  color: var(--primary);
}

.calendar-day {
  display: grid;
  position: relative;
  align-content: start;
  justify-items: start;
  gap: 8px;
  min-height: clamp(70px, 8vw, 118px);
  padding: 10px;
  text-align: left;
}

.calendar-day span {
  font-weight: 900;
}

.calendar-day.has-entries::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d64037;
  transform: translateX(-50%);
}

.calendar-day.is-outside {
  color: #a6aaa7;
  background: #f7f4ed;
}

.calendar-day.is-selected {
  box-shadow: inset 0 0 0 3px rgba(47, 99, 183, 0.32);
}

.calendar-side {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.calendar-side-head {
  display: flex;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #e6f0ec;
  color: var(--primary);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

.selected-team-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calendar-counts {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.calendar-counts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-strong);
  padding: 10px;
}

.calendar-counts span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calendar-counts strong {
  color: var(--ink);
  font-size: 18px;
}

.team-work-summary {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.team-work-summary:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.side-work-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.side-work-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.side-work-section h3 {
  margin-bottom: 7px;
}

.side-work-section ol,
.detail-block ol {
  margin: 0;
  padding-left: 20px;
}

.side-work-section li,
.detail-block li {
  margin: 6px 0;
  line-height: 1.4;
}

.side-work-section p {
  color: var(--muted);
}

.report-work-block {
  display: grid;
  gap: 10px;
}

.report-work-block > .detail-block {
  border: 1px solid var(--line);
  border-left: 4px solid var(--team-accent);
  border-radius: var(--radius);
  padding: 10px;
}

.report-filters {
  grid-template-columns: 1fr;
}

.report-page-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-page-content[data-team-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.report-page-content[data-team-count="1"] .report-team-panel {
  min-height: min(460px, calc(100svh - 260px));
}

.report-page-content[data-team-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.day-summary-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.day-summary-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 12px;
}

.day-summary-head,
.day-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-summary-head h3 {
  font-size: 18px;
}

.day-summary-head span,
.day-team-head strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eee9df;
  font-size: 12px;
  font-weight: 900;
}

.day-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.day-team-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--team-accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.day-summary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.day-summary-columns h4,
.day-request-block h4 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.day-request-block {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.day-request-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.day-item-list {
  margin: 0;
  padding-left: 19px;
}

.day-item-list li {
  margin: 6px 0;
  line-height: 1.42;
}

.day-item-list small,
.day-empty {
  color: var(--muted);
  font-size: 11px;
}

.day-empty {
  margin: 0;
}

.report-team-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  max-height: calc(100svh - 260px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--team-accent);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 14px;
  box-shadow: var(--shadow);
}

.report-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-team-head strong {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eee9df;
  font-size: 13px;
}

.report-work-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: calc(100svh - 340px);
  overflow: auto;
  padding-right: 2px;
}

.report-work-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.report-work-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
}

.report-work-body {
  display: grid;
  gap: 5px;
}

.report-work-item p {
  color: var(--ink);
  line-height: 1.45;
}

.report-work-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.report-entry {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--team-accent);
  border-radius: var(--radius);
  padding: 10px;
  margin-top: 8px;
}

.report-entry-lists {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.report-entry-list {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.report-entry-list h4 {
  margin-bottom: 5px;
  font-size: 13px;
}

.report-entry-list ol {
  margin: 0;
  padding-left: 20px;
}

.report-entry-list li {
  margin: 5px 0;
  line-height: 1.4;
}

.report-entry-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.report-entry-list p {
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--line);
}

.summary-item {
  background: var(--surface-strong);
  padding: 12px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-item strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.entry-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.entry-card {
  display: grid;
  gap: 10px;
  border: 0;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.entry-card:hover {
  background: #fbf7ee;
}

.entry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--team-accent) 12%, white);
  color: var(--team-accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.entry-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.entry-card h3 {
  font-size: 17px;
}

.entry-card p {
  color: var(--muted);
  line-height: 1.45;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button {
  background: #f5dfdc;
  color: var(--danger);
}

.detail-panel {
  margin-top: 12px;
  padding: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(23, 33, 31, 0.36);
  padding: 18px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(560px, 100%);
  max-height: min(720px, calc(100svh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: var(--panel-pad);
  box-shadow: 0 26px 70px rgba(23, 33, 31, 0.24);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--gap);
}

.export-form {
  display: grid;
  gap: var(--gap);
}

.export-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.export-modal-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.detail-block h3 {
  margin-bottom: 6px;
}

.detail-block p {
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

@media (max-width: 1024px) {
  .app-header,
  .app-nav,
  main {
    width: min(100% - 32px, 920px);
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-side {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .calendar-counts {
    grid-template-columns: repeat(3, 1fr);
  }

  .day-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-page-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-page-content[data-team-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: max(12px, env(safe-area-inset-top)) 0 8px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.02;
  }

  .status-stack {
    max-width: none;
    justify-content: flex-start;
    gap: 6px;
  }

  .status-pill,
  .status-action {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .team-grid,
  .meta-grid,
  .filters,
  .request-grid,
  .summary-strip,
  .export-period-grid,
  .team-work-toolbar,
  .calendar-toolbar,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .team-work-lists .item-add-row {
    grid-template-columns: 1fr;
  }

  .team-work-page-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .team-work-page-button {
    min-height: 42px;
    padding: 8px;
    font-size: 13px;
  }

  .team-work-page-button strong {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .basic-overview-head,
  .basic-overview-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .basic-overview-head span,
  .basic-overview-row span,
  .basic-overview-row small {
    grid-column: 1;
  }

  .basic-overview-head strong,
  .basic-overview-row strong {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .priority-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .priority-button {
    width: 100%;
  }

  .team-work-lists .item-add-row > [data-action="add-item"] {
    width: 100%;
  }

  .form-page-menu {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .form-page-menu::-webkit-scrollbar {
    display: none;
  }

  .form-page-button {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .team-card {
    min-height: 0;
  }

  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 0 10px;
  }

  .section-head p {
    margin-top: 2px;
    font-size: 13px;
  }

  #changeTeamButton {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .export-actions {
    width: 100%;
  }

  .export-actions > button,
  .report-actions > button {
    flex: 1;
  }

  .report-actions {
    width: 100%;
  }

  .calendar-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .calendar-toolbar > button {
    min-height: 38px;
    padding-inline: 6px;
    font-size: 12px;
    line-height: 1.1;
  }

  .app-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    padding: 6px 14px 8px;
    background: rgba(245, 242, 235, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(221, 215, 204, 0.75);
  }

  .nav-button {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
    line-height: 1.15;
  }

  .meeting-form {
    padding: 10px;
  }

  .form-page {
    min-height: 0;
  }

  .item-group {
    gap: 8px;
    padding-block: 0 8px;
  }

  .item-group-head h3 {
    font-size: 14px;
  }

  .sticky-actions {
    position: static;
    padding-top: 8px;
    background: none;
  }

  .calendar-weekdays,
  .calendar-week {
    grid-template-columns: 40px repeat(7, minmax(0, 1fr));
  }

  .calendar-grid {
    overflow-x: hidden;
  }

  .calendar-weekdays span {
    padding: 8px 2px;
    font-size: 10px;
  }

  .week-report-button {
    min-height: 52px;
    padding: 4px 2px;
    font-size: 11px;
  }

  .calendar-day {
    min-height: 52px;
    gap: 4px;
    padding: 6px 4px;
    justify-items: center;
    text-align: center;
  }

  .calendar-day span {
    font-size: 11px;
    line-height: 1;
  }

  .calendar-day.has-entries::after {
    bottom: 6px;
    width: 7px;
    height: 7px;
  }

  .calendar-side {
    grid-template-columns: 1fr;
  }

  .calendar-counts {
    grid-template-columns: 1fr;
  }

  .report-page-content {
    grid-template-columns: 1fr;
  }

  .day-summary-grid,
  .day-summary-columns {
    grid-template-columns: 1fr;
  }

  .report-page-content[data-team-count="1"] .report-team-panel {
    min-height: auto;
  }

  .report-work-list {
    max-height: min(430px, 58svh);
  }

  .item-table-head,
  .list-item {
    grid-template-columns: 24px minmax(0, 1fr) 42px 48px;
  }

  .item-table-head.has-priority,
  .list-item.has-priority {
    grid-template-columns: 24px 30px minmax(0, 1fr) 42px 48px;
  }

  .item-table-head span,
  .item-cell {
    padding: 6px 3px;
  }

  .item-content {
    padding-inline: 4px 6px;
  }

  .item-table-head {
    font-size: 9px;
  }

  .priority-pill {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .list-item-body p {
    font-size: 13px;
    line-height: 1.32;
  }

  .item-owner {
    display: grid;
    gap: 4px;
    font-size: 9px;
  }

  .repeat-chip {
    min-height: 18px;
    padding-inline: 5px;
    font-size: 10px;
  }

  .item-actions {
    justify-content: center;
    gap: 3px;
  }

  .tiny-button {
    min-width: 34px;
    min-height: 25px;
    padding: 0 3px;
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  .app-header,
  main {
    width: min(100% - 22px, 960px);
  }

  h1 {
    font-size: 20px;
  }

  .nav-button,
  button,
  .secondary-button {
    padding-inline: 10px;
    font-size: 14px;
  }

  .form-page-button {
    padding-inline: 10px;
    font-size: 11px;
  }

  .meeting-form {
    padding: 9px;
  }

  .item-table-head,
  .list-item {
    grid-template-columns: 22px minmax(0, 1fr) 38px 44px;
  }

  .item-table-head.has-priority,
  .list-item.has-priority {
    grid-template-columns: 22px 28px minmax(0, 1fr) 38px 44px;
  }

  .item-table-head span,
  .item-cell {
    padding-inline: 2px;
  }

  .item-content {
    padding-inline: 4px;
  }

  .tiny-button {
    min-width: 32px;
    font-size: 9px;
  }

  .calendar-toolbar {
    gap: 4px;
  }

  .calendar-toolbar > button {
    min-height: 34px;
    padding-inline: 4px;
    font-size: 11px;
  }

  .calendar-weekdays,
  .calendar-week {
    grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  }

  .calendar-weekdays span {
    font-size: 9px;
    padding: 7px 1px;
  }

  .week-report-button,
  .calendar-day {
    min-height: 46px;
  }

  .week-report-button {
    font-size: 10px;
  }

  .calendar-day {
    padding: 5px 2px;
  }

  .calendar-day span {
    font-size: 10px;
  }

  .calendar-day.has-entries::after {
    bottom: 5px;
    width: 6px;
    height: 6px;
  }
}
