:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-soft: #eef5f8;
  --line: #d8e4eb;
  --line-strong: #c5d5df;
  --text: #142536;
  --muted: #65788a;
  --blue: #246bdf;
  --blue-soft: #e8f0ff;
  --green: #23875a;
  --green-soft: #e8f7ee;
  --amber: #a46a00;
  --amber-soft: #fff4d8;
  --red: #b83232;
  --red-soft: #fdeaea;
  --shadow: 0 10px 28px rgba(21, 46, 70, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  margin: 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item,
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 10px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}

.nav-item.active .icon {
  background: var(--surface);
}

.caption,
.eyebrow,
.field span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 12px 24px;
  background: rgba(245, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

strong,
small,
span {
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0;
  font-size: 23px;
  font-weight: 720;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 21px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  letter-spacing: 0;
}

p {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions,
.toolbar,
.row-actions,
.dialog-actions,
.prototype-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.field.compact {
  min-width: 210px;
}

input,
select,
textarea {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

textarea {
  height: auto;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 107, 223, 0.14);
}

.toggle {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toggle input {
  width: 16px;
  height: 16px;
}

.button,
.icon-button,
.segmented button {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button {
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.secondary {
  background: var(--surface);
}

.button.ghost {
  border-color: transparent;
  color: var(--blue);
}

.icon-button {
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

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

.mobile-menu {
  display: none !important;
}

.content {
  width: 100%;
  max-width: 1480px;
  padding: 22px 24px 36px;
  margin: 0 auto;
  overflow-x: hidden;
}

.notice,
.prototype-controls,
.panel,
.metric,
.package-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prototype-controls {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8fbfd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prototype-controls span {
  color: var(--muted);
  margin-left: 8px;
}

.notice span {
  color: var(--muted);
  margin-left: 8px;
}

.admin-only {
  display: none;
}

.app-shell[data-admin="true"] .admin-only {
  display: flex;
}

.app-shell[data-admin="true"] .nav-item.admin-only {
  display: grid;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

.metric {
  min-height: 132px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 9px;
}

.task-metric-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-metric-details small {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.metric-link {
  cursor: pointer;
}

.metric-link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.metric-status-button {
  border: 0;
  cursor: pointer;
}

.metric-status-button:hover {
  filter: brightness(0.98);
}

.metric strong {
  font-size: 18px;
}

.meter,
.timeline-scale {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: #e5edf3;
  overflow: visible;
}

.meter span,
.timeline-scale span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  overflow: hidden;
}

.meter.done span {
  background: var(--green);
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.status.good {
  background: var(--green-soft);
  color: var(--green);
}

.status.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.muted {
  background: #edf1f4;
  color: var(--muted);
}

.status.custom {
  background: var(--status-bg);
  color: var(--status-fg);
}

.status.temperature-0 {
  background: #e8f1ff;
  color: #2f66b3;
}

.status.temperature-1 {
  background: #e7f7ff;
  color: #19749a;
}

.status.temperature-2 {
  background: #e5f8f1;
  color: #1d7e62;
}

.status.temperature-3 {
  background: #f4f7df;
  color: #7a741e;
}

.status.temperature-4 {
  background: #fff0d9;
  color: #9a640f;
}

.status.temperature-5 {
  background: #ffe8df;
  color: #aa5532;
}

.status.temperature-6 {
  background: #ffe6eb;
  color: #a74662;
}

.two-column {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.panel {
  padding: 14px;
}

.panel-head,
.package-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.activity-list,
.license-list,
.meeting-list {
  display: grid;
  gap: 8px;
}

.activity-row,
.license-row,
.meeting-row {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.activity-row {
  padding: 10px;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 9px;
}

small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
}

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

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

.status-dot.amber {
  background: #d79310;
}

.license-row {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.license-row span {
  min-width: 0;
}

.license-row strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.license-row.risk strong {
  color: var(--red);
}

.segmented {
  min-height: 38px;
  padding: 3px;
  border-radius: var(--radius);
  background: #e7eef3;
  display: inline-flex;
  gap: 3px;
}

.segmented button {
  min-width: 116px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(21, 46, 70, 0.08);
}

.toolbar {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.toolbar-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-action {
  display: flex;
  justify-content: flex-end;
}

.data-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.table-row {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.clickable:hover {
  background: #f7fbff;
}

.task-row.is-selected {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.table-row.is-hidden {
  display: none;
}

.table-empty {
  min-height: 74px;
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  display: none;
}

.table-empty.is-visible {
  display: block;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.pagination .button {
  min-height: 36px;
  padding: 8px 12px;
}

.table-head {
  min-height: 42px;
  background: #edf4f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-table .table-row {
  grid-template-columns: 80px minmax(280px, 1.5fr) 90px minmax(120px, 0.7fr) 120px;
}

.time-table .table-row {
  grid-template-columns: 86px minmax(300px, 1fr) 160px 140px;
}

.user-table .table-row {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) 130px 150px 100px;
}

.table-row.child {
  min-height: 44px;
  background: #fbfdff;
  color: var(--muted);
  padding-left: 34px;
}

.time-row strong {
  color: inherit;
}

.time-task-row strong,
.time-type-row strong {
  color: var(--blue);
}

.time-task-row.is-expanded,
.time-type-row.is-expanded {
  background: #f7fbff;
}

.time-type-row {
  min-height: 48px;
  background: #fbfdff;
}

.time-type-row span:nth-child(2) {
  padding-left: 28px;
}

.time-entry-row {
  min-height: 56px;
  background: #fff;
  color: var(--muted);
}

.time-entry-row span:nth-child(2) {
  padding-left: 56px;
}

.time-entry-row strong {
  color: var(--muted);
  font-weight: 500;
}

.time-section-row {
  min-height: 42px;
  background: #eef6fb;
  color: var(--ink);
  font-weight: 800;
}

.time-section-row span {
  grid-column: 1 / -1;
}

.time-list-task-row strong {
  color: var(--blue);
}

.time-list-entry-row span:first-child {
  white-space: nowrap;
}

.rating {
  color: #c58900;
  letter-spacing: 0;
  white-space: nowrap;
}

.task-state {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.task-score {
  color: #8a6200;
  font-weight: 700;
  white-space: nowrap;
}

.task-detail-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task-table .task-detail-panel {
  width: 100%;
}

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

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

.task-detail-head h3 {
  margin-top: 2px;
  font-size: 18px;
}

.task-detail-grid {
  padding-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.task-comment-form,
.task-feedback-form {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.form-head h4 {
  margin: 0;
  font-size: 15px;
}

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

.comment-feed {
  display: grid;
  gap: 8px;
}

.comment-item {
  padding: 10px 12px;
  border-left: 3px solid var(--line-strong);
  background: #f8fbfd;
}

.comment-item.client {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.comment-item strong {
  display: block;
  margin-bottom: 3px;
}

.comment-item p {
  color: var(--text);
}

.field.wide {
  width: 100%;
  min-width: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.form-status {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.form-status.success {
  color: #20734b;
}

.form-status.error {
  color: #b52931;
}

.score-list {
  display: grid;
  gap: 10px;
}

.score-row {
  min-height: 50px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.score-row:first-child {
  padding-top: 0;
}

.score-row span {
  font-weight: 650;
}

.score-buttons {
  display: inline-grid;
  grid-template-columns: repeat(5, 34px);
  gap: 5px;
}

.score-buttons button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.score-buttons button:hover,
.score-buttons button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.package-sections {
  display: grid;
  gap: 22px;
}

.package-section {
  display: grid;
  gap: 10px;
}

.package-section h3 {
  margin: 0;
  font-size: 18px;
}

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

.package-item {
  min-height: 230px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.active-package {
  border-color: #b7d4bf;
}

.package-top > span {
  display: grid;
  gap: 8px;
}

.package-top strong {
  font-size: 18px;
}

.package-number {
  align-self: start;
  color: var(--muted);
  font-size: 10pt;
}

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

.package-stats span {
  min-height: 50px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.package-stats b {
  display: block;
}

.report-panel {
  margin-bottom: 12px;
}

.time-package-switcher {
  width: min(640px, 100%);
  margin-bottom: 12px;
}

.time-package-switcher select {
  width: 100%;
}

.report-summary {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.report-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
}

.timeline-scale {
  height: 14px;
}

.meter i,
.timeline-scale i {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--surface);
}

.meeting-row {
  padding: 12px;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 12px;
}

time {
  color: var(--muted);
  white-space: nowrap;
}

.bottom-nav {
  display: none;
}

.login-dialog {
  width: min(430px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.docs-dialog {
  width: min(720px, calc(100vw - 28px));
}

.docs-dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  z-index: 50;
}

.meeting-dialog {
  width: min(860px, calc(100vw - 28px));
}

.task-create-dialog {
  width: min(720px, calc(100vw - 28px));
}

.meeting-dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  z-index: 60;
}

.task-create-dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  z-index: 60;
}

.login-dialog::backdrop {
  background: rgba(20, 37, 54, 0.32);
}

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

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

.dialog-head h2 {
  margin-bottom: 0;
}

.file-field input[type="file"] {
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfdff;
}

.meeting-dialog-head {
  align-items: start;
}

.meeting-dialog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.meeting-content-body {
  min-height: 180px;
  max-height: min(64vh, 620px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  white-space: pre-wrap;
  line-height: 1.55;
}

.docs-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 560px);
  overflow: auto;
}

.docs-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: var(--surface-soft);
}

.docs-row:hover {
  border-color: var(--blue);
  background: #f7fbff;
}

.docs-row strong {
  font-size: 15px;
}

.docs-row small,
.docs-empty {
  color: var(--muted);
}

.docs-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

  .sidebar {
    padding-inline: 10px;
  }

  .brand img,
  .brand span,
  .nav-item span:last-child,
  .brand {
    justify-content: center;
  }

  .brand::after {
    content: "S";
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

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

  .two-column,
  .package-grid,
  .task-detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .bottom-nav button {
    min-height: 42px;
    border-radius: var(--radius);
    font-size: 18px;
  }

  .bottom-nav button.active {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-menu {
    display: none !important;
  }

  .topbar {
    min-height: unset;
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .topbar-actions {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .topbar-main {
    flex: 1 1 auto;
  }

  .topbar-main h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .field,
  .field.compact,
  .button,
  input,
  select,
  textarea,
  .toggle {
    width: 100%;
    min-width: 0;
  }

  .topbar .company-switcher {
    position: relative;
    width: 42px;
    min-width: 42px;
    height: 42px;
    display: block;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  .topbar .company-switcher::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 8px;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23142536' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 20.5h10.8'/%3E%3Cpath d='M6.2 20.5V5.4c0-.9.7-1.6 1.6-1.6h5.5c.9 0 1.6.7 1.6 1.6v15.1'/%3E%3Cpath d='M9.4 7.8h2.4M9.4 11.5h2.4M9.4 15.2h2.4'/%3E%3Cpath d='M17.6 7.2h3.2v3.2'/%3E%3Cpath d='M20.6 7.4c-1.1-1.5-2.8-2.5-4.7-2.7'/%3E%3Cpath d='M20 15.6h-3.2v-3.2'/%3E%3Cpath d='M17 15.4c1.1 1.5 2.8 2.5 4.7 2.7'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
  }

  .topbar .company-switcher > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .topbar .company-switcher select {
    position: absolute;
    inset: 0;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    opacity: 0;
    appearance: none;
    cursor: pointer;
  }

  .topbar .session-actions {
    width: 42px;
    min-width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .topbar #siteLogoutButton {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 0;
  }

  .topbar #siteLogoutButton::before {
    content: "";
    width: 25px;
    height: 25px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23142536' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.2 4.2H6.1c-.9 0-1.6.7-1.6 1.6v12.4c0 .9.7 1.6 1.6 1.6h3.1'/%3E%3Cpath d='M13 8l4 4-4 4'/%3E%3Cpath d='M17 12H8.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .content {
    padding: 14px;
  }

  .topbar-main,
  .topbar-main > div,
  .workspace,
  .content,
  .view,
  .view.active,
  .panel,
  .metric,
  .package-item,
  .task-detail-panel,
  .task-detail-grid,
  .task-comment-form,
  .task-feedback-form,
  .report-summary,
  .timeline-scale,
  .activity-row,
  .license-row,
  .meeting-row,
  .table-row,
  .topbar-actions,
  .toolbar,
  .toolbar-filters,
  .row-actions {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .notice {
    align-items: stretch;
    flex-direction: column;
  }

  .prototype-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .prototype-controls span {
    display: block;
    margin: 2px 0 0;
  }

  .notice span {
    display: block;
    margin: 2px 0 0;
  }

  .summary-grid,
  .report-summary,
  .package-stats {
    grid-template-columns: 1fr;
  }

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

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

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

  .toolbar-action {
    justify-content: stretch;
  }

  .task-detail-head,
  .form-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .score-buttons {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .score-buttons button {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    min-width: 0;
  }

  .data-table {
    display: grid;
    gap: 10px;
    border: 0;
    background: transparent;
    overflow: hidden;
  }

  .table-row,
  .task-table .table-row,
  .time-table .table-row,
  .user-table .table-row {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: unset;
    padding: 12px;
    width: 100%;
    overflow-x: hidden;
  }

  .table-head {
    display: none;
  }

  .table-row.child {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--blue-soft);
  }

  .time-table .time-task-row {
    border-color: var(--line);
  }

  .time-table .time-type-row {
    width: calc(100% - 22px);
    margin-left: 22px;
    padding-left: 14px;
    border-left: 4px solid var(--blue-soft);
    background: #f7fbff;
  }

  .time-table .time-entry-row {
    width: calc(100% - 44px);
    margin-left: 44px;
    padding-left: 14px;
    border-left: 4px solid var(--line-strong);
    background: var(--surface);
  }

  .time-table .time-type-row span:nth-child(2),
  .time-table .time-entry-row span:nth-child(2) {
    padding-left: 0;
  }

  .time-table .time-entry-row strong {
    font-size: 14px;
  }

  .meeting-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .row-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .row-actions .button {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  .metric,
  .panel,
  .package-item {
    padding: 12px;
  }

  .time-table .time-type-row {
    width: calc(100% - 14px);
    margin-left: 14px;
  }

  .time-table .time-entry-row {
    width: calc(100% - 28px);
    margin-left: 28px;
  }
}
