:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --surface-soft: #eef4ee;
  --ink: #18221f;
  --muted: #66736d;
  --line: #dbe3dc;
  --line-strong: #c5d1c8;
  --accent: #227459;
  --accent-strong: #155f49;
  --accent-soft: #e3f1eb;
  --blue: #2f6690;
  --amber: #a86710;
  --red: #b84a3f;
  --red-soft: #f7e6e3;
  --yellow-soft: #fff4db;
  --blue-soft: #e6f0f7;
  --shadow: 0 18px 40px rgba(30, 48, 38, 0.08);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(34, 116, 89, 0.05), transparent 36%),
    var(--bg);
}

body.is-locked .app-shell {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(245, 247, 243, 0.92);
  backdrop-filter: blur(10px);
}

.login-screen.is-visible {
  display: grid;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0 0 8px;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.remember-login input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.card-system-entry {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 8px;
  background: #16a34a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.2);
}

.card-system-entry:hover {
  background: #15803d;
}

.icp-footer {
  position: fixed;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  font-size: 12px;
}

.icp-footer a {
  color: var(--muted);
  pointer-events: auto;
  text-decoration: none;
}

.icp-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 26px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.brand-mark span {
  width: 18px;
  height: 18px;
  border: 5px solid var(--accent);
  border-top-color: var(--blue);
  border-radius: 50%;
}

.brand-block h1,
.brand-block p,
.topbar h2,
.topbar p,
.section-head h3,
.section-head p {
  margin: 0;
}

.brand-block h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand-block p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(34, 116, 89, 0.07);
}

.nav-item.is-active {
  color: var(--accent-strong);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  font-weight: 700;
}

.nav-section-break {
  height: 8px;
  border-bottom: 1px solid var(--line);
}

.nav-icon {
  display: inline-grid;
  width: 22px;
  place-items: center;
  color: currentColor;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-card-system-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
}

.sidebar-card-system-link:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.server-nav-item {
  width: 100%;
  color: var(--ink);
  background: var(--surface-soft);
}

.settings-nav-item {
  width: 100%;
  color: var(--ink);
  background: var(--surface-soft);
}

.user-panel {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.user-panel strong {
  font-size: 14px;
}

.user-panel span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

body.is-objectives-view .main {
  max-width: none;
}

body.is-timeline-view .main {
  max-width: none;
}

body.is-objectives-view .topbar {
  width: min(100%, 1716px);
  padding-left: 236px;
}

body.is-timeline-view .topbar,
#timelineView {
  width: min(100%, 1840px);
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

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

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.objective-card,
.action-card,
.checkin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  min-height: 126px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.server-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.server-resource-grid > .empty-state {
  grid-column: 1 / -1;
}

.server-resource-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.server-resource-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.server-resource-head p,
.server-resource-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.server-resource-head h4 {
  margin: 5px 0 0;
  font-size: 20px;
}

.server-resource-head > strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1;
  text-align: right;
}

.server-resource-head > strong span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.server-resource-track {
  width: 100%;
  height: 12px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.server-resource-used {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.server-resource-panel[data-resource="disk"] .server-resource-used {
  background: var(--blue);
}

.server-resource-panel[data-resource="disk"] .server-resource-head > strong {
  color: var(--blue);
}

.server-resource-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.server-resource-values > div {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.server-resource-values span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.server-resource-values strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.server-resource-meta {
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.settings-save-state {
  color: var(--muted);
  font-size: 12px;
}

.settings-workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  min-height: 560px;
}

.settings-section-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.settings-section-nav button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.settings-section-nav button:hover,
.settings-section-nav button.is-active {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-soft);
}

.settings-section-nav button.is-active {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.settings-section-nav strong,
.settings-section-nav span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section-nav strong {
  font-size: 14px;
}

.settings-section-nav span {
  font-size: 11px;
}

.settings-detail-panel {
  min-width: 0;
  padding: 22px;
}

.settings-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-detail-head h3 {
  margin-top: 4px;
}

.settings-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.settings-status.is-ready {
  border-color: rgba(34, 116, 89, 0.28);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form-grid label,
.settings-test-row label,
.reminder-time-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-toggle-row,
.reminder-enable {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-toggle-row {
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.settings-toggle-row input,
.reminder-enable input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-toggle-row span,
.reminder-enable span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-toggle-row small,
.reminder-enable small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.settings-test-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reminder-rule-list {
  border-top: 1px solid var(--line);
}

.reminder-rule-row {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 150px auto;
  gap: 16px;
  align-items: end;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

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

.reminder-rule-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.reminder-rule-actions span {
  color: var(--muted);
  font-size: 11px;
}

.reminder-template-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.reminder-template-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: 700;
}

.reminder-template-body {
  min-height: 260px;
  resize: vertical;
}

.content-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

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

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

.objective-toolbar {
  align-items: center;
}

.segmented {
  display: inline-flex;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment {
  min-width: 72px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.segment[data-objective-scope="history"] {
  min-width: 112px;
}

.segment.is-active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(30, 48, 38, 0.08);
}

.filter-inline {
  width: min(260px, 100%);
}

.filter-inline.small {
  width: 160px;
}

.section-head h3 {
  margin-top: 4px;
  font-size: 18px;
}

.compact-head {
  margin-bottom: 12px;
}

.page-head {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.primary-button,
.ghost-button,
.text-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  padding: 0 15px;
  border: 1px solid var(--accent-strong);
  color: white;
  background: var(--accent);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.control {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.control[readonly] {
  color: var(--muted);
  background: #f3f6f4;
  cursor: not-allowed;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.report-output {
  min-height: 360px;
  white-space: pre-wrap;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.report-hint {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.5;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-head {
  display: grid;
  gap: 4px;
}

.objective-list,
.checkin-list,
.risk-list {
  display: grid;
  gap: 12px;
}

#objectivesView.is-visible {
  width: min(100%, 1716px);
  grid-template-columns: 220px minmax(0, 1480px);
  column-gap: 16px;
  row-gap: 18px;
  align-items: start;
}

#objectivesView .page-head,
#objectivesView #objectiveList {
  grid-column: 2;
  min-width: 0;
}

.objective-outline {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 134px);
  min-height: 620px;
  max-height: 100vh;
  grid-column: 1;
  grid-row: 1 / span 2;
  gap: 0;
  align-content: start;
  padding: 0 12px 0 0;
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  background: transparent;
}

.objective-outline-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line);
}

.objective-outline-head h4,
.objective-outline-empty {
  margin: 0;
}

.objective-outline-head h4 {
  font-size: 14px;
}

.objective-outline-head > span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.objective-outline-list {
  display: grid;
  grid-auto-flow: row;
  gap: 2px;
  align-content: start;
  overflow-y: auto;
  padding: 8px 2px 8px 0;
  scrollbar-gutter: stable;
}

.objective-outline-item {
  display: grid;
  width: 100%;
  min-height: 50px;
  grid-template-columns: 18px 32px minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: start;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.objective-outline-item:hover,
.objective-outline-item:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.objective-outline-item.is-active {
  border-color: rgba(34, 116, 89, 0.18);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.objective-outline-item > .drag-handle {
  margin-top: 1px;
  opacity: 0.42;
}

.objective-outline-item:hover > .drag-handle,
.objective-outline-item:focus-visible > .drag-handle,
.objective-outline-item.is-active > .drag-handle {
  opacity: 1;
}

.drag-handle {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  min-height: 24px;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  cursor: grab;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.drag-handle:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.objective-outline-item.is-drag-over,
.kr-row.is-drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent);
}

.objective-outline-index,
.objective-outline-progress {
  padding-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.objective-outline-index {
  color: var(--accent-strong);
}

.objective-outline-progress {
  text-align: right;
}

.objective-outline-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.objective-outline-empty {
  padding: 12px 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.objective-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.objective-card--full {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(30, 48, 38, 0.05);
  scroll-margin-top: 18px;
}

#objectiveList {
  gap: 18px;
}

.objective-card.compact-item {
  gap: 12px;
}

.objective-summary {
  display: grid;
  gap: 16px;
}

.objective-card--full .objective-summary {
  padding: 18px;
}

.objective-card.compact-item .objective-summary {
  gap: 12px;
}

.objective-boundary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: #f3f8f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.objective-boundary > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.objective-boundary-main {
  flex: 1 1 auto;
  min-width: 0;
}

.objective-kr-filter.segmented {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 2px;
  border-color: #c7d8cc;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.objective-kr-filter .segment {
  display: inline-flex;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.objective-kr-filter .segment > span {
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 8px;
  color: var(--muted);
  background: #e5ece7;
  font-size: 10px;
  line-height: 1;
}

.objective-kr-filter .segment.is-active > span {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.objective-boundary-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-range {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-range > span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  white-space: nowrap;
}

.objective-index {
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #86b99a;
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1;
}

.objective-boundary-label {
  color: var(--text);
}

.objective-kr-section {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
}

.objective-kr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.objective-kr-head h5 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.objective-kr-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.objective-head,
.kr-row,
.action-head,
.checkin-head,
.risk-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.objective-title {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.objective-title > div {
  flex: 1 1 auto;
  min-width: 0;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.status-dot.at-risk {
  background: var(--amber);
}

.status-dot.blocked {
  background: var(--red);
}

.status-dot.done {
  background: var(--blue);
}

.objective-title h4,
.action-card h4,
.checkin-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.objective-title p,
.action-card p,
.checkin-card p,
.risk-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.meta-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 220px;
}

.objective-meta-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 46%);
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.green {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.tag.amber {
  color: var(--amber);
  background: var(--yellow-soft);
}

.tag.red {
  color: var(--red);
  background: var(--red-soft);
}

.tag.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.objective-files {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  margin-left: auto;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.objective-file-chip {
  display: inline-flex;
  flex: 0 1 128px;
  min-width: 42px;
  max-width: 128px;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfb;
  font-size: 11px;
}

.objective-file-chip a {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-file-chip a:hover {
  text-decoration: underline;
}

.file-chip-meta {
  display: none;
}

.file-chip-delete {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 5px;
  border: 1px solid rgba(184, 74, 63, 0.35);
  border-radius: 6px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.progress-bar.low {
  background: var(--amber);
}

.progress-bar.mid {
  background: var(--amber);
}

.progress-line {
  display: grid;
  gap: 8px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.kr-list {
  display: grid;
  gap: 8px;
}

.kr-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kr-row.is-deleted {
  border-style: dashed;
  border-color: #c8ced0;
  background: #f5f6f6;
}

.kr-row.is-deleted .kr-main {
  opacity: 0.68;
}

.kr-row > .drag-handle {
  margin-top: 1px;
}

.kr-main {
  flex: 1;
  min-width: 0;
}

.kr-row-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.kr-schedule-range {
  justify-content: flex-end;
}

.kr-main h5 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

.kr-number {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
}

.kr-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.kr-task-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kr-task-list {
  display: grid;
  gap: 8px;
}

.kr-task-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.kr-task-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.kr-task-row.is-done .kr-task-input {
  color: var(--muted);
  text-decoration: line-through;
  background: #f3f6f4;
}

.kr-task-summary {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.kr-task-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kr-task-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.kr-task-chip.is-done {
  color: var(--muted);
  text-decoration: line-through;
  background: var(--surface-soft);
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mini-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.pin-button {
  min-width: 30px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.pin-button.is-pinned {
  border-color: rgba(195, 122, 24, 0.4);
  color: #9b5c0c;
  background: var(--yellow-soft);
}

.bottom-button {
  min-width: 30px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.bottom-button.is-bottomed {
  border-color: rgba(68, 104, 156, 0.4);
  color: #315d91;
  background: #eaf1fb;
}

.mini-button:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.mini-button.primary {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mini-button.mini-danger {
  color: var(--red);
  border-color: rgba(184, 74, 63, 0.42);
  background: var(--red-soft);
}

.mini-button.mini-danger:hover {
  color: var(--red);
  border-color: var(--red);
}

.timeline-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.timeline-summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-summary > div,
.timeline-legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-summary span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-legend span {
  display: inline-grid;
  min-width: 26px;
  min-height: 24px;
  place-items: center;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: 700;
}

.timeline-legend .objective {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.timeline-legend .kr {
  color: #275ca8;
  background: #eaf2ff;
}

.timeline-scroll {
  min-width: 0;
  min-height: 360px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.timeline-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.timeline-table {
  --timeline-day-width: 38px;
  width: max-content;
  min-width: 100%;
}

.timeline-line {
  display: grid;
  min-height: 52px;
  grid-template-columns: 300px var(--timeline-track-width);
}

.timeline-header-line {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 52px;
}

.timeline-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px 12px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.timeline-row-label > span {
  display: inline-grid;
  min-height: 25px;
  place-items: center;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.timeline-line--kr .timeline-row-label > span {
  color: #275ca8;
  background: #eaf2ff;
}

.timeline-row-label > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timeline-row-label strong,
.timeline-row-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-row-label strong {
  font-size: 12px;
}

.timeline-row-label small {
  color: var(--muted);
  font-size: 10px;
}

.timeline-row-label--head {
  z-index: 8;
  background: #f7faf7;
}

.timeline-row-label--head strong,
.timeline-row-label--head small {
  grid-column: 1 / -1;
}

.timeline-axis {
  display: flex;
  width: var(--timeline-track-width);
  border-bottom: 1px solid var(--line-strong);
  background: #f7faf7;
}

.timeline-day {
  display: grid;
  flex: 0 0 var(--timeline-day-width);
  min-width: 0;
  place-items: center;
  align-content: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.timeline-day small {
  min-height: 14px;
  font-size: 9px;
}

.timeline-day strong {
  font-size: 11px;
}

.timeline-day.is-weekend {
  background: #f2f5f3;
}

.timeline-day.is-today {
  color: var(--red);
  background: var(--red-soft);
}

.timeline-track {
  position: relative;
  width: var(--timeline-track-width);
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--timeline-day-width) - 1px),
    var(--line) calc(var(--timeline-day-width) - 1px),
    var(--line) var(--timeline-day-width)
  );
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

body.is-readonly .timeline-track {
  cursor: default;
}

.timeline-selection-preview {
  position: absolute;
  z-index: 3;
  top: 5px;
  display: none;
  height: 38px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
}

.timeline-track.is-selecting .timeline-selection-preview {
  display: block;
}

.timeline-track.is-selecting .timeline-bar {
  opacity: 0.45;
}

body.is-selecting-timeline-range,
body.is-selecting-timeline-range * {
  cursor: crosshair !important;
  user-select: none !important;
}

.timeline-bar {
  position: absolute;
  top: 13px;
  height: 26px;
  overflow: hidden;
  border: 1px solid #6ea987;
  border-radius: 6px;
  background: #dceee3;
  box-shadow: 0 2px 5px rgba(38, 91, 61, 0.12);
}

.timeline-line--kr .timeline-bar {
  top: 16px;
  height: 20px;
  border-color: #7ca5dd;
  background: #dfeaff;
}

.timeline-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  opacity: 0.32;
}

.timeline-line--kr .timeline-bar > span {
  background: #4d7fc3;
}

.timeline-bar strong {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  padding: 0 6px;
  overflow: hidden;
  color: #214c32;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-line--kr .timeline-bar strong {
  color: #244f89;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

.board-column {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.board-column h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.action-card,
.checkin-card {
  padding: 13px;
}

.action-card {
  display: grid;
  gap: 12px;
}

.action-card.is-overdue {
  border-color: rgba(184, 74, 63, 0.45);
  background: #fffafa;
}

.risk-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.risk-item strong {
  font-size: 14px;
}

.commerce-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
}

.data-table td strong {
  display: block;
  margin-bottom: 3px;
}

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

.review-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.review-metric-grid .metric-card {
  min-height: 112px;
  padding: 15px;
}

.review-metric-grid .metric-card strong {
  font-size: 28px;
}

.review-analysis-panel {
  margin-bottom: 16px;
}

.review-kr-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-kr-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.review-kr-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.review-kr-head h4 {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.45;
}

.review-kr-head p,
.review-kr-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-kr-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-kr-facts span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.fixed-task-toolbar {
  align-items: center;
}

.segment[data-fixed-task-scope="registered"] {
  min-width: 104px;
}

.segment[data-fixed-task-scope="history"] {
  min-width: 120px;
}

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

.fixed-task-summary-item {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fixed-task-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fixed-task-summary-item strong {
  color: var(--ink);
  font-size: 24px;
}

.fixed-task-list {
  display: grid;
  gap: 8px;
}

.fixed-task-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.fixed-task-main {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.fixed-task-title-line {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
}

.fixed-task-title-line h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-task-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.fixed-task-status.todo {
  border-color: rgba(195, 122, 24, 0.28);
  color: #9b5c0c;
  background: var(--yellow-soft);
}

.fixed-task-status.done {
  border-color: rgba(34, 116, 89, 0.25);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.fixed-task-status.archived {
  color: var(--muted);
  background: var(--surface-soft);
}

.fixed-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12px;
}

.fixed-task-note {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-task-actions {
  flex: 0 0 auto;
}

.danger-button {
  color: var(--red);
}

.danger-button:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.form-span-full {
  grid-column: 1 / -1;
}

.modal.fixed-task-editor-modal {
  width: min(1800px, calc(100vw - 48px));
  max-width: none;
}

.fixed-task-editor-card {
  height: min(1000px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.form-grid.fixed-task-form-grid {
  min-height: 0;
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(180px, 0.8fr)
    minmax(180px, 0.8fr)
    minmax(460px, 1.7fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}

.fixed-task-form-grid > label,
.fixed-task-frequency {
  min-width: 0;
}

.fixed-task-frequency {
  display: grid;
  gap: 7px;
}

.fixed-task-frequency-tabs {
  width: 100%;
}

.fixed-task-frequency-tabs .segment {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

.fixed-task-frequency-detail {
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
  align-items: center;
  padding-top: 5px;
}

.fixed-task-frequency-detail[hidden] {
  display: none;
}

.fixed-task-frequency-detail .field-label {
  margin: 0;
}

.fixed-task-frequency-detail .field-help {
  grid-column: 1 / -1;
}

.fixed-task-note-field {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.fixed-task-note-field .textarea {
  height: 100%;
  min-height: 260px;
  resize: none;
}

@media (min-width: 781px) and (max-width: 1180px) {
  .form-grid.fixed-task-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .fixed-task-frequency {
    grid-column: 1 / -1;
  }
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.fixed-task-log-modal {
  width: min(920px, calc(100vw - 24px));
}

.fixed-task-log-card {
  max-height: calc(100vh - 36px);
  grid-template-rows: auto auto minmax(220px, 1fr);
  overflow: hidden;
}

.fixed-task-log-editor {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.fixed-task-log-editor label {
  display: grid;
  gap: 7px;
}

.fixed-task-log-editor .primary-button {
  min-height: 42px;
}

.fixed-task-log-history {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.fixed-task-log-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fixed-task-log-history-head h4 {
  margin: 0;
  font-size: 14px;
}

.fixed-task-log-history-head span {
  color: var(--muted);
  font-size: 12px;
}

.fixed-task-log-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
}

.fixed-task-log-item {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fixed-task-log-item > div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.fixed-task-log-item span {
  color: var(--muted);
  font-size: 11px;
}

.fixed-task-log-item p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.modal {
  width: min(720px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(17, 25, 22, 0.38);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-card.small {
  width: min(520px, calc(100vw - 24px));
}

.memo-modal {
  width: min(1040px, calc(100vw - 24px));
}

.memo-card {
  min-height: min(760px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(420px, 1fr);
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 4px 0 0;
}

.memo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.memo-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.memo-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.memo-editor {
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
}

.memo-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.memo-editor h3,
.memo-editor h4,
.memo-editor p {
  margin: 0 0 10px;
}

.memo-editor ul,
.memo-editor ol {
  margin: 0 0 10px 24px;
}

.memo-check-row {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 8px;
}

.memo-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.memo-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.memo-check-row input[type="checkbox"]:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.document-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(190px, 0.9fr) minmax(160px, 0.75fr) auto;
  gap: 12px;
  align-items: end;
}

.files-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 22px 26px;
}

.files-page-head h3 {
  margin: 4px 0 0;
  font-size: 26px;
}

.files-page-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.files-page-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.files-limit-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.file-upload-button {
  gap: 7px;
  cursor: pointer;
}

.file-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.files-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 0.88fr) minmax(0, 1.65fr);
  gap: 14px;
  min-height: min(690px, calc(100vh - 280px));
}

.files-upload-panel,
.files-list-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.files-upload-panel .compact-head,
.files-list-panel .compact-head {
  flex: 0 0 auto;
}

.files-count {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 11px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}

.files-queue-status {
  color: var(--muted);
  font-size: 12px;
}

.files-upload-list,
.files-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.file-upload-row,
.user-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 82px;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.file-row-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.file-row-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-main span {
  color: var(--muted);
  font-size: 12px;
}

.file-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.file-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.file-upload-status {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.file-upload-row.done .file-upload-status {
  color: var(--accent-strong);
}

.file-upload-row.failed .file-upload-status,
.file-upload-row.too-large .file-upload-status {
  color: var(--danger, #b04444);
}

.file-upload-row.failed .file-progress-track span,
.file-upload-row.too-large .file-progress-track span {
  background: var(--danger, #b04444);
}

.user-file-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  color: var(--danger, #b04444);
}

body.is-files-view .main {
  max-width: none;
}

body.is-files-view .topbar {
  min-height: 52px;
  margin-bottom: 14px;
}

body.is-files-view .topbar > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

body.is-files-view .topbar > div:first-child .eyebrow {
  order: 2;
  margin: 0;
  white-space: nowrap;
}

body.is-files-view .topbar > div:first-child h2 {
  order: 1;
  margin: 0;
}

body.is-files-view #filesView {
  gap: 14px;
}

.document-topbar-new {
  display: none;
}

body.is-documents-view .main {
  max-width: none;
}

body.is-documents-view .topbar {
  min-height: 52px;
  margin-bottom: 18px;
}

body.is-documents-view .topbar > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

body.is-documents-view .topbar > div:first-child .eyebrow {
  order: 2;
  margin: 0;
  white-space: nowrap;
}

body.is-documents-view .topbar > div:first-child h2 {
  order: 1;
  margin: 0;
}

body.is-documents-view .document-topbar-new {
  display: inline-flex;
}

body.is-documents-view #documentsView > .document-toolbar {
  margin-top: 0;
}

.document-toolbar label,
.document-scope-wrap,
.document-category-filter {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.document-category-control {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.document-category-control .control {
  min-width: 0;
  flex: 1;
}

.document-category-control .icon-button {
  flex: 0 0 38px;
  min-height: 38px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.document-scope-wrap .segmented {
  min-height: 38px;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(190px, 0.5fr) minmax(0, 2fr);
  gap: 12px;
  height: min(720px, calc(100vh - 250px));
  min-height: 520px;
}

.document-list-panel,
.document-outline-panel,
.document-preview-panel {
  min-width: 0;
  min-height: 0;
}

.document-list-panel,
.document-outline-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.document-list-panel .compact-head {
  flex: 0 0 auto;
}

.document-list,
.document-outline {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-outline-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.document-outline-head h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.document-outline-head .eyebrow {
  margin: 0;
}

.document-depth-control {
  min-width: 62px;
}

.document-depth-control .control {
  min-height: 32px;
  padding: 0 7px;
  font-size: 12px;
}

.document-outline {
  display: grid;
  align-content: start;
  gap: 2px;
  padding-top: 10px;
}

.document-outline-item {
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-outline-item:hover {
  border-left-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.document-outline-item.level-2 { padding-left: 16px; }
.document-outline-item.level-3 { padding-left: 24px; }
.document-outline-item.level-4 { padding-left: 32px; }
.document-outline-item.level-5 { padding-left: 40px; }

.document-category-list {
  display: grid;
  gap: 8px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.document-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.document-category-row .control {
  min-width: 0;
}

.document-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.document-list-item.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.document-select {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.document-list-title {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list-meta,
.document-list-summary,
.document-preview-head p {
  color: var(--muted);
  font-size: 12px;
}

.document-list-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list-tags,
.document-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.document-list-tags .tag,
.document-preview-tags .tag {
  padding: 2px 6px;
  font-size: 11px;
}

.document-list-actions {
  align-self: center;
}

.document-preview-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.document-preview-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.document-preview-head h3 {
  margin: 10px 0 4px;
  font-size: 22px;
}

.document-preview-head p,
.document-preview-summary {
  margin: 0;
}

.document-preview-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--surface-soft);
  line-height: 1.6;
}

.document-preview-content {
  min-height: 0;
  padding-top: 20px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-preview-content h1,
.document-preview-content h2,
.document-preview-content h3,
.document-preview-content h4,
.document-preview-content h5,
.document-preview-content p {
  margin: 0 0 12px;
  scroll-margin-top: 12px;
}

.document-preview-content ul,
.document-preview-content ol {
  margin: 0 0 12px 24px;
}

.document-preview-content a {
  color: var(--accent-strong);
}

.document-modal {
  width: calc(100vw - 24px);
  max-width: none;
}

.document-card {
  min-height: min(900px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.document-editor-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1.62fr);
  gap: 12px;
  min-height: 0;
}

.document-editor-outline-panel {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.document-editor-outline-panel .document-outline {
  max-height: 100%;
}

.document-editor-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

.document-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.document-editor-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.document-editor-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.document-block-level,
.document-color-control {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.document-block-level {
  padding: 0 8px;
}

.document-color-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0 7px;
}

.document-color-control input {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.document-editor-scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-editor {
  min-height: 600px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
}

.document-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.document-editor h1,
.document-editor h2,
.document-editor h3,
.document-editor h4,
.document-editor h5,
.document-editor p {
  margin: 0 0 10px;
  scroll-margin-top: 12px;
}

.document-editor ul,
.document-editor ol {
  margin: 0 0 10px 24px;
}

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

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

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.danger {
  margin-right: auto;
  color: var(--red);
}

.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
  text-align: center;
}

body[data-theme="blue"] {
  --bg: #f3f7fb;
  --surface-soft: #e8f0f7;
  --accent: #2f6690;
  --accent-strong: #1f5278;
  --accent-soft: #deedf7;
}

body[data-theme="amber"] {
  --bg: #fffaf2;
  --surface-soft: #fff1dc;
  --accent: #b36b18;
  --accent-strong: #8e4f0b;
  --accent-soft: #ffebc8;
}

body[data-theme="rose"] {
  --bg: #fff6f7;
  --surface-soft: #fbe9ec;
  --accent: #b5485d;
  --accent-strong: #913447;
  --accent-soft: #f8dfe5;
}

body[data-theme] {
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body.is-objectives-view .main {
  max-width: none;
}

body.is-objectives-view .topbar {
  width: min(100%, 1920px);
  padding-left: 216px;
}

#objectivesView.is-visible {
  width: min(100%, 1920px);
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 14px;
  align-items: start;
}

#objectivesView .page-head,
#objectivesView .objective-filter-row,
#objectivesView #objectiveList {
  grid-column: 2;
  min-width: 0;
}

#objectivesView .page-head {
  grid-row: 1;
  margin-bottom: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

#objectivesView .objective-filter-row {
  grid-row: 2;
}

#objectivesView #objectiveList {
  grid-row: 3;
}

.objective-outline-toggle {
  display: none;
}

.objective-outline {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 200px;
  min-height: 0;
  height: calc(100vh - 118px);
  max-height: calc(100vh - 118px);
  padding-right: 12px;
  top: 0;
}

.objective-outline-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.objective-outline-head > div > span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.objective-outline-close {
  display: none;
}

.objective-cycle-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.objective-filter-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0 4px;
}

.objective-stat-line {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.objective-stat-line span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}

.objective-stat-line strong {
  color: var(--ink);
  font-size: 16px;
}

.objective-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.objective-toolbar .filter-inline.small {
  width: 150px;
}

.objective-card--full .objective-summary {
  padding: 15px 18px 14px;
}

.objective-card--full {
  box-shadow: 0 6px 18px rgba(30, 48, 38, 0.04);
}

.objective-boundary {
  min-height: 40px;
  padding: 6px 18px;
  background: var(--surface-soft);
}

.objective-boundary-main {
  gap: 8px;
}

.objective-boundary-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.objective-title h4 {
  font-size: 17px;
  line-height: 1.35;
}

.objective-title p {
  margin-top: 4px;
  font-size: 13px;
}

.objective-meta-line {
  display: block;
  margin-top: 8px;
}

.objective-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.objective-actions {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  grid-template-rows: repeat(2, minmax(28px, auto));
  flex: 0 0 auto;
  justify-content: end;
  align-items: center;
}

.objective-actions > .file-action {
  grid-column: 1;
  grid-row: 1;
}

.objective-actions > [data-edit-objective] {
  grid-column: 2;
  grid-row: 1;
}

.objective-actions > [data-complete-objective],
.objective-actions > [data-restore-objective],
.objective-actions > [data-unhide-objective] {
  grid-column: 3;
  grid-row: 1;
}

.objective-actions > [data-open-objective-memo] {
  grid-column: 1;
  grid-row: 2;
}

.objective-actions > [data-copy-objective] {
  grid-column: 2;
  grid-row: 2;
}

.objective-actions > [data-add-kr] {
  grid-column: 3;
  grid-row: 2;
}

.objective-actions > [data-delete-objective] {
  grid-column: 4;
  grid-row: 2;
}

.kr-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  grid-template-rows: repeat(2, minmax(28px, auto));
  justify-content: end;
  align-items: center;
}

.objective-progress-row,
.kr-progress-row {
  display: grid;
  gap: 20px;
  align-items: center;
}

.objective-progress-row {
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  margin-top: 12px;
}

.objective-progress-row > .progress-line {
  width: min(100%, 50%);
  min-width: 300px;
}

.objective-schedule-range,
.kr-inline-meta {
  justify-content: flex-end;
}

.objective-progress-row .schedule-range {
  min-width: 250px;
}

.progress-label strong {
  color: var(--ink);
  font-size: 13px;
}

.action-badge {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  line-height: 1;
}

.action-menu {
  position: relative;
  flex: 0 0 auto;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 104px;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(30, 48, 38, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.action-menu:hover .action-menu-popover,
.action-menu:focus-within .action-menu-popover,
.action-menu[open] .action-menu-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.action-menu-popover .mini-button {
  width: 100%;
  text-align: left;
}

.kr-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

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

.kr-main h5 {
  margin-bottom: 7px;
}

.kr-progress-row {
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
}

.kr-inline-meta {
  display: flex;
  min-width: 250px;
  gap: 8px;
  align-items: center;
}

.kr-task-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.kr-row-tools {
  align-self: center;
}

.kr-task-summary {
  margin-top: 8px;
}

.kr-task-items {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.kr-task-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.kr-task-chip {
  cursor: pointer;
}

button.kr-task-chip:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.objective-files-modal {
  width: min(980px, calc(100vw - 24px));
}

.objective-files-card {
  min-height: min(680px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
}

.objective-files-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.objective-files-upload {
  width: fit-content;
  cursor: pointer;
}

.objective-file-manager-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  padding: 2px;
}

.objective-file-manager-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.objective-file-manager-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.objective-file-manager-main a {
  overflow: hidden;
  color: var(--accent-strong);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-file-manager-main span {
  color: var(--muted);
  font-size: 12px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.theme-option {
  display: grid;
  gap: 10px;
  min-height: 112px;
  align-content: center;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.theme-option:hover,
.theme-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-option.is-active {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.theme-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.theme-swatch-green { background: #227459; }
.theme-swatch-blue { background: #2f6690; }
.theme-swatch-amber { background: #b36b18; }
.theme-swatch-rose { background: #b5485d; }

@media (max-width: 1180px) {
  #objectivesView.is-visible {
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView .objective-filter-row,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  #objectivesView .page-head { grid-row: 2; }
  #objectivesView .objective-filter-row { grid-row: 3; }
  #objectivesView #objectiveList { grid-row: 4; }

  .objective-outline-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    font-size: 13px;
  }

  .objective-outline {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 220px;
    z-index: 40;
    display: grid;
    width: min(300px, calc(100vw - 250px));
    height: auto;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.is-objective-outline-open .objective-outline {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .objective-outline-close {
    display: inline-grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  body.is-objective-outline-open::after {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 25, 22, 0.2);
    content: "";
  }

  .objective-filter-row {
    align-items: flex-start;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.is-objectives-view .topbar {
    padding-left: 0;
  }

  .objective-outline {
    top: 12px;
    right: 12px;
    bottom: 86px;
    left: 12px;
    width: auto;
  }

  .objective-filter-row {
    display: grid;
    gap: 10px;
  }

  .objective-stat-line {
    gap: 10px;
    overflow: hidden;
    font-size: 12px;
  }

  .objective-stat-line strong {
    font-size: 15px;
  }

  .objective-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .objective-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .objective-toolbar .filter-inline.small {
    width: 100%;
  }

  .objective-head {
    flex-direction: column;
  }

  .objective-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-progress-row,
  .kr-progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .objective-progress-row > .progress-line {
    width: 100%;
    min-width: 0;
  }

  .objective-progress-row .schedule-range,
  .kr-inline-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .kr-row-tools {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
  }

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

  .objective-files-manager-head,
  .objective-file-manager-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .objective-files-upload,
  .objective-file-manager-row .mini-button {
    width: 100%;
  }
}

@media (min-width: 1361px) {
  body.is-objectives-view .topbar {
    min-height: 36px;
    margin-bottom: 10px;
    justify-content: flex-end;
  }

  body.is-objectives-view .topbar > div:first-child {
    display: none;
  }

  .objective-outline {
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
    min-height: 0;
    max-height: calc(100vh - 24px);
    align-self: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .objective-outline-list {
    max-height: calc(100vh - 108px);
  }
}

@media (max-width: 780px) {
  body.is-objectives-view .topbar {
    display: none;
  }

  .objective-actions .mini-button {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }
}

.mobile-tabbar,
.mobile-more-sheet {
  display: none;
}

@media (max-width: 1360px) {
  body.is-objectives-view .main {
    max-width: 1480px;
  }

  body.is-timeline-view .main {
    max-width: 1480px;
  }

  body.is-objectives-view .topbar {
    width: 100%;
    padding-left: 0;
  }

  body.is-timeline-view .topbar,
  #timelineView {
    width: 100%;
  }

  #objectivesView.is-visible {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  .objective-outline {
    display: none;
  }
}

@media (max-width: 1120px) {
  .metric-grid,
  .review-metric-grid,
  .review-kr-list,
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-split,
  .review-grid,
  .document-workspace {
    grid-template-columns: 1fr;
  }

  .document-workspace {
    height: auto;
    min-height: 0;
  }

  .document-list-panel,
  .document-outline-panel {
    max-height: 300px;
  }

  .document-preview-panel {
    height: 620px;
  }

  .reminder-rule-row {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .reminder-rule-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
    min-width: 88px;
    padding: 0 8px;
    font-size: 13px;
  }

  .nav-icon {
    display: none;
  }

  .sidebar-footer {
    margin-top: 14px;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .icp-footer {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .review-metric-grid,
  .review-kr-list,
  .board,
  .form-grid,
  .form-grid.three,
  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .objective-head,
  .kr-row,
  .action-head,
  .checkin-head {
    flex-direction: column;
  }

  .objective-meta-line {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .objective-files {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .mini-actions {
    justify-content: flex-start;
  }

  .kr-row {
    position: relative;
  }

  .kr-row > .drag-handle {
    position: absolute;
    top: 14px;
    left: 14px;
  }

  .kr-row .kr-main {
    width: 100%;
    padding-left: 26px;
  }

  .kr-row-tools {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .kr-schedule-range {
    padding-left: 26px;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  body {
    padding-bottom: 86px;
    background: #f1f5f2;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar {
    display: none;
  }

  .main {
    max-width: none;
    padding: 0 14px 26px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    flex-direction: row;
    min-height: 62px;
    margin: 0 -14px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 247, 243, 0.94);
    backdrop-filter: blur(14px);
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .topbar-actions .icon-button,
  .topbar-actions .file-button {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .view {
    gap: 14px;
  }

  .page-head {
    padding-bottom: 12px;
  }

  .page-head .eyebrow {
    display: none;
  }

  .section-head {
    gap: 10px;
  }

  .section-head h3 {
    font-size: 17px;
  }

  .section-actions,
  .objective-toolbar,
  .document-toolbar {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }

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

  .document-search {
    grid-column: 1 / -1;
  }

  .document-scope-wrap .segmented {
    width: 100%;
  }

  .document-scope-wrap .segment {
    flex: 1;
  }

  .objective-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .objective-toolbar .segment {
    flex: 0 0 auto;
  }

  .objective-toolbar .filter-inline {
    width: 100%;
  }

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

  .server-resource-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .server-resource-panel {
    padding: 18px 14px;
  }

  .server-resource-head h4 {
    font-size: 17px;
  }

  .server-resource-head > strong {
    font-size: 24px;
  }

  .server-resource-values {
    gap: 8px;
    margin-top: 17px;
  }

  .server-resource-values strong {
    font-size: 15px;
  }

  .settings-workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
  }

  .settings-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-section-nav button {
    min-height: 52px;
  }

  .settings-detail-panel {
    padding: 14px;
  }

  .settings-form-grid,
  .settings-test-row,
  .reminder-rule-row {
    grid-template-columns: 1fr;
  }

  .settings-test-row {
    align-items: stretch;
  }

  .settings-test-row button {
    width: 100%;
  }

  .reminder-rule-row {
    gap: 12px;
  }

  .reminder-rule-actions {
    display: grid;
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-rule-actions button {
    width: 100%;
    min-width: 0;
  }

  .reminder-rule-actions .primary-button {
    grid-column: 1 / -1;
  }

  .settings-toggle-row small,
  .reminder-enable small {
    white-space: normal;
  }

  .metric-card {
    min-height: 108px;
    padding: 14px;
  }

  .metric-card strong {
    margin-top: 12px;
    font-size: 27px;
  }

  .metric-card span {
    margin-top: 9px;
  }

  .panel,
  .objective-card,
  .kr-row,
  .action-card,
  .checkin-card {
    padding: 14px;
  }

  .objective-card {
    gap: 13px;
  }

  .objective-card--full {
    gap: 0;
  }

  .objective-card--full .objective-summary {
    gap: 14px;
    padding: 14px;
  }

  .objective-boundary {
    min-height: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 8px 14px;
  }

  .objective-boundary-main {
    width: 100%;
    flex-wrap: wrap;
  }

  .objective-kr-filter.segmented {
    order: 3;
    width: 100%;
    margin-top: 2px;
  }

  .objective-kr-filter .segment {
    flex: 1 1 25%;
    min-height: 30px;
    padding: 0 4px;
    font-size: 11px;
  }

  .objective-boundary-meta {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .objective-kr-section {
    gap: 10px;
    padding: 13px 14px 14px;
  }

  .objective-title h4,
  .action-card h4,
  .checkin-card h4 {
    font-size: 15px;
  }

  .mini-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-button {
    min-height: 34px;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .objective-files {
    padding-bottom: 2px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .timeline-toolbar .segmented,
  .timeline-toolbar .filter-inline {
    width: 100%;
  }

  .timeline-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .timeline-scroll {
    min-height: 420px;
    max-height: calc(100vh - 260px);
  }

  .timeline-line {
    grid-template-columns: 210px var(--timeline-track-width);
  }

  .timeline-row-label {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 8px 10px;
  }

  .board-column {
    padding: 10px;
  }

  .commerce-table-wrap {
    margin: 0 -14px;
    padding: 0 14px;
  }

  .data-table {
    min-width: 680px;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .modal-card,
  .memo-card,
  .document-card {
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .memo-card {
    min-height: 72vh;
    grid-template-rows: auto auto minmax(300px, 1fr);
  }

  .document-card {
    min-height: 76vh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .memo-editor {
    min-height: 300px;
  }

  .document-editor {
    min-height: 360px;
  }

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

  .document-editor-outline-panel {
    max-height: 190px;
  }

  .document-editor-scroll {
    min-height: 300px;
  }

  .document-preview-head {
    display: grid;
  }

  .document-list-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .document-list-actions {
    justify-content: flex-start;
  }

  .document-category-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(30, 48, 38, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-tab-button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-tab-button > span:first-child {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-tab-button.is-active {
    color: var(--accent-strong);
    background: var(--accent-soft);
  }

  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    pointer-events: none;
  }

  .mobile-sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(17, 25, 22, 0.38);
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .mobile-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 14px;
    max-height: min(78vh, 640px);
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 44px rgba(24, 34, 31, 0.18);
    transform: translateY(105%);
    transition: transform 220ms ease;
  }

  body.is-mobile-menu-open {
    overflow: hidden;
  }

  body.is-mobile-menu-open .mobile-more-sheet {
    pointer-events: auto;
  }

  body.is-mobile-menu-open .mobile-sheet-backdrop {
    opacity: 1;
  }

  body.is-mobile-menu-open .mobile-sheet-panel {
    transform: translateY(0);
  }

  .mobile-sheet-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto -4px;
    border-radius: 4px;
    background: var(--line-strong);
  }

  .mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-sheet-head h3,
  .mobile-sheet-head p {
    margin: 0;
  }

  .mobile-sheet-head h3 {
    margin-top: 3px;
    font-size: 18px;
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-sheet-grid button,
  .mobile-sheet-upload {
    display: grid;
    gap: 5px;
    min-height: 74px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fbfcfb;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }

  .mobile-sheet-grid button > span,
  .mobile-sheet-upload > span {
    color: var(--accent-strong);
    font-size: 19px;
    line-height: 1;
  }

  .mobile-sheet-upload {
    position: relative;
    cursor: pointer;
  }

  .mobile-sheet-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
  }

  .mobile-cycle-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-new-cycle {
    width: 100%;
  }

  .mobile-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .mobile-account > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-account strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-account span {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-account-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
  }

  .mobile-account-actions .text-button {
    min-height: 32px;
    font-size: 13px;
  }

  .toast {
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 780px) {
  .fixed-task-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .fixed-task-toolbar .segment {
    flex: 1 0 auto;
  }

  .fixed-task-toolbar .primary-button {
    width: 100%;
  }

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

  .fixed-task-summary-item {
    min-height: 54px;
    padding: 10px 12px;
  }

  .fixed-task-summary-item strong {
    font-size: 21px;
  }

  .fixed-task-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .fixed-task-title-line {
    align-items: flex-start;
  }

  .fixed-task-title-line h4,
  .fixed-task-note {
    white-space: normal;
  }

  .fixed-task-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fixed-task-frequency-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fixed-task-frequency-tabs .segment {
    min-height: 36px;
  }

  .modal.fixed-task-editor-modal {
    width: 100%;
  }

  .fixed-task-editor-card {
    height: 88vh;
    min-height: 0;
    max-height: 88vh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .form-grid.fixed-task-form-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
  }

  .fixed-task-frequency-detail {
    grid-template-columns: 1fr;
  }

  .fixed-task-frequency-detail .field-help {
    grid-column: 1;
  }

  .fixed-task-note-field .textarea {
    height: auto;
    min-height: 220px;
    resize: vertical;
  }

  .fixed-task-log-card {
    max-height: calc(100vh - 20px);
    grid-template-rows: auto auto minmax(180px, 1fr);
    padding: 16px;
  }

  .fixed-task-log-editor {
    grid-template-columns: 1fr;
  }

  .fixed-task-log-editor .primary-button {
    width: 100%;
  }

  .fixed-task-log-item > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-tab-button {
    font-size: 10px;
  }
}

.data-transfer-actions,
.objective-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-transfer-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.objective-page-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

#objectiveDataTransferSlot {
  display: flex;
  min-width: 0;
}

body.is-documents-view .main {
  max-width: none;
}

body.is-documents-view .topbar {
  min-height: 48px;
  margin-bottom: 10px;
  gap: 12px;
}

body.is-documents-view .topbar h2 {
  font-size: 22px;
}

body.is-documents-view .topbar-actions {
  flex-wrap: nowrap;
}

body.is-documents-view #documentsView {
  gap: 10px;
}

.document-modal-head {
  min-height: 30px;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.document-form-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(160px, 0.75fr) minmax(220px, 1fr);
  gap: 8px 10px;
}

.document-form-grid > label {
  min-width: 0;
}

.document-form-grid .field-label {
  margin-bottom: 4px;
}

.document-form-grid .control {
  min-height: 36px;
}

.document-form-grid .document-summary-field {
  grid-column: 1 / -1;
}

.document-form-grid .document-summary-field .textarea {
  min-height: 54px;
  max-height: 76px;
}

body.is-objectives-view .main {
  padding-top: 12px;
}

body.is-timeline-view .main {
  padding-top: 12px;
}

body.is-objectives-view .topbar,
body.is-timeline-view .topbar {
  display: none;
}

body.is-objectives-view #objectivesView.is-visible {
  margin-top: 0;
}

#timelineView .timeline-page-head {
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
}

.timeline-page-title {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 10px;
}

.timeline-page-title h3 {
  flex: 0 0 auto;
  margin: 0;
}

.timeline-cycle-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

.timeline-toolbar .segmented,
.timeline-toolbar .filter-inline,
#timelineDataTransferSlot,
#timelineDataTransferSlot .data-transfer-actions {
  flex: 0 0 auto;
}

#timelineDataTransferSlot,
#timelineDataTransferSlot .data-transfer-actions {
  display: flex;
}

@media (min-width: 781px) {
  body.is-documents-view .main {
    padding-right: 0;
    padding-left: 0;
  }
}

@media (max-width: 780px) {
  .objective-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-page-actions .data-transfer-actions {
    display: none;
  }

  .document-form-grid {
    grid-template-columns: 1fr;
  }

  .document-form-grid .document-summary-field {
    grid-column: 1;
  }

  .files-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .files-page-actions {
    width: 100%;
    justify-content: space-between;
  }

  .files-workspace {
    grid-template-columns: 1fr;
  }

  .file-upload-row,
  .user-file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .file-upload-row .file-progress-track,
  .file-upload-row .file-upload-status {
    grid-column: 1 / -1;
  }

  .file-upload-row .file-upload-status {
    text-align: left;
  }

  .user-file-row .file-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 1360px) {
  #timelineView .timeline-page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .timeline-toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #objectivesView.is-visible {
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView .objective-filter-row,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  #objectivesView .page-head { grid-row: 2; }
  #objectivesView .objective-filter-row { grid-row: 3; }
  #objectivesView #objectiveList { grid-row: 4; }

  .objective-outline-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    font-size: 13px;
  }

  .objective-outline {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 220px;
    z-index: 40;
    display: grid;
    width: min(300px, calc(100vw - 250px));
    height: auto;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.is-objective-outline-open .objective-outline {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .objective-outline-close {
    display: inline-grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  body.is-objective-outline-open::after {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 25, 22, 0.2);
    content: "";
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.is-objectives-view .topbar {
    padding-left: 0;
  }

  .objective-outline {
    top: 12px;
    right: 12px;
    bottom: 86px;
    left: 12px;
    width: auto;
  }

  .objective-filter-row {
    display: grid;
    gap: 10px;
  }

  .timeline-page-title {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .timeline-cycle-meta {
    flex-basis: 100%;
  }

  #timelineDataTransferSlot {
    display: none;
  }

  .objective-stat-line {
    gap: 10px;
    overflow: hidden;
    font-size: 12px;
  }

  .objective-stat-line strong {
    font-size: 15px;
  }

  .objective-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .objective-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .objective-toolbar .filter-inline.small {
    width: 100%;
  }

  .objective-head {
    flex-direction: column;
  }

  .objective-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-progress-row,
  .kr-progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .objective-progress-row > .progress-line {
    width: 100%;
    min-width: 0;
  }

  .objective-progress-row .schedule-range,
  .kr-inline-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .kr-row-tools {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
  }

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

  .objective-files-manager-head,
  .objective-file-manager-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .objective-files-upload,
  .objective-file-manager-row .mini-button {
    width: 100%;
  }
}
