:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --line: #d9e0e7;
  --text: #17202a;
  --muted: #697586;
  --blue: #2869a6;
  --teal: #117c74;
  --coral: #c5534d;
  --amber: #9a6a13;
  --shadow: 0 12px 30px rgba(31, 42, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-block,
.status-strip,
.app-nav,
.sidebar-head,
.section-bar,
.section-title,
.action-row,
.vas-row,
.pain-toggles {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.brand-mark.large {
  width: 44px;
  height: 44px;
}

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

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

h2 {
  font-size: 16px;
}

h3 {
  font-size: 14px;
}

p {
  color: var(--muted);
  font-size: 12px;
}

.status-strip {
  gap: 8px;
}

.app-nav {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.app-nav-button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.app-nav-button.active {
  background: var(--teal);
  color: #fff;
}

.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

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

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) minmax(520px, 1fr);
  gap: 12px;
  padding: 12px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.workspace.app-view.active {
  display: grid;
}

.management-view {
  flex: 1;
  padding: 12px;
}

.management-panel {
  min-height: calc(100vh - 92px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.management-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.management-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.management-content {
  padding: 14px 16px 18px;
}

.management-content-panel {
  display: none;
}

.management-content-panel.active {
  display: grid;
  gap: 14px;
}

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

.inline-panel-head p {
  margin-top: 4px;
}

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

.auth-gate {
  flex: 1;
  display: none;
  place-items: center;
  padding: 32px;
}

.auth-locked .auth-gate {
  display: grid;
}

.auth-locked .topbar {
  justify-content: flex-start;
}

.auth-locked .status-strip {
  display: none;
}

.auth-locked .workspace {
  display: none;
}

.auth-locked .management-view {
  display: none;
}

.auth-locked .app-view,
.auth-locked .workspace.app-view.active {
  display: none;
}

.auth-gate-panel {
  width: min(430px, calc(100vw - 48px));
  display: grid;
  gap: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-panel-head h2 {
  font-size: 20px;
}

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

.login-form p {
  min-height: 18px;
}

.login-form button {
  width: 100%;
  height: 42px;
}

.auth-gate-panel h2 {
  font-size: 20px;
}

.auth-gate-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar,
.chart-panel,
.preview-panel {
  height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar,
.preview-panel {
  display: flex;
  flex-direction: column;
}

.sidebar {
  min-height: 0;
  padding: 14px;
}

.sidebar-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.search-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.type-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.type-filter-button {
  height: 30px;
  min-width: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.type-filter-button.active {
  background: var(--teal);
  color: white;
  box-shadow: 0 5px 14px rgba(17, 124, 116, 0.18);
}

label span,
.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

input,
select {
  height: 36px;
  padding: 0 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 124, 116, 0.12);
}

input[readonly] {
  background: #edf7f5;
  color: var(--teal);
  font-weight: 800;
}

input:disabled,
select:disabled {
  background: #edf0f3;
  color: var(--muted);
  cursor: not-allowed;
}

.patient-list {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.patient-row {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  text-align: left;
}

.patient-row.active {
  border-color: var(--teal);
  background: #edf8f6;
}

.patient-row strong {
  font-size: 14px;
}

.patient-row small {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 14px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.chart-panel {
  overflow: auto;
}

.section-bar {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chart-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 76px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.segment {
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segment.active {
  background: var(--teal);
  color: #fff;
}

.chart-form {
  display: grid;
  gap: 12px;
  padding: 14px 16px 18px;
}

.form-section,
.therapy-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.section-title {
  min-height: 44px;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f4f7fa;
  border-bottom: 1px solid var(--line);
}

.section-title output {
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0ef;
  color: var(--coral);
  text-align: center;
  font-weight: 800;
}

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

.therapy-grid.tight {
  padding: 0;
}

.field-grid.compact {
  padding-top: 0;
}

.field-grid label,
.therapy-grid label {
  display: grid;
  gap: 6px;
}

.span-2 {
  grid-column: span 2;
}

.check-section {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.check-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.check-block h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.hint {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

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

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

.check-grid.consent {
  grid-template-columns: 1fr;
}

.check-grid label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.check-grid input {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.wide-text {
  display: grid;
  gap: 6px;
}

.validation-panel {
  display: none;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff8e7;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.validation-panel.active {
  display: block;
}

.validation-panel strong {
  color: var(--coral);
}

.vas-row {
  align-items: stretch;
  gap: 12px;
  padding: 12px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--coral);
}

.pain-toggles {
  gap: 6px;
}

.pain-toggles label,
.inline-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pain-toggles input,
.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.rom-table {
  display: grid;
  padding: 0 12px 12px;
}

.rom-head,
.rom-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 96px 110px 120px;
  gap: 8px;
  align-items: center;
}

.rom-head {
  height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rom-row {
  min-height: 42px;
  border-top: 1px solid var(--line);
}

.rom-row .move-name {
  font-weight: 700;
}

.rom-row .normal-value {
  color: var(--muted);
  font-size: 12px;
}

.therapy-pane {
  display: none;
}

.therapy-pane.active {
  display: block;
}

.preview-panel {
  overflow: hidden;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-actions p {
  display: none;
}

.record-action-row {
  display: grid;
  grid-template-columns: 70px 52px 52px;
  gap: 6px;
}

.record-action-row button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.report-preview {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fbfcfd;
  line-height: 1.55;
  font-size: 13px;
  resize: none;
}

.preview-panel.review-active .report-preview {
  flex: 0 1 48%;
  min-height: 260px;
}

.ai-review-panel {
  flex: 1 1 52%;
  min-height: 320px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #f7fbfa;
}

.ai-review-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ecf7f5;
  border-bottom: 1px solid var(--line);
}

.ai-review-head strong {
  font-size: 13px;
}

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

.ai-review-content {
  display: grid;
  gap: 10px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.ai-review-content h4 {
  margin: 0 0 6px;
  font-size: 12px;
}

.ai-review-content ul {
  margin: 0;
  padding-left: 18px;
}

.ai-review-content blockquote {
  margin: 0;
  padding: 10px;
  border-left: 3px solid var(--teal);
  background: #fff;
}

.ai-review-progress {
  display: grid;
  gap: 10px;
}

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

.ai-review-progress-head strong {
  font-size: 13px;
}

.ai-review-progress-percent {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.ai-review-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9e8;
}

.ai-review-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.35s ease;
}

.action-row {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  flex: 1;
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  padding: 0 12px;
}

.danger-button {
  background: #fff;
  border-color: #efc9c6;
  color: var(--coral);
  padding: 0 12px;
}

.ghost-button {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  padding: 0 10px;
}

.icon-button {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

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

.account-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(20, 30, 43, 0.3);
}

.account-dialog {
  width: 620px;
}

.account-dialog.wide-dialog {
  width: min(920px, calc(100vw - 40px));
}

.account-dialog::backdrop {
  background: rgba(23, 32, 42, 0.36);
}

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

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

.dialog-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.icon-button.light {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

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

.account-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-top: 4px;
}

.management-content .account-list {
  max-height: none;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.account-row div {
  display: grid;
  gap: 4px;
}

.account-row > div:first-child {
  min-width: 0;
}

.account-row small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-row.inactive {
  opacity: 0.56;
}

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

.audit-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.management-content .audit-list {
  max-height: none;
}

.audit-row {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

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

.audit-row-head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e5f3f1;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.audit-row small,
.audit-row p {
  color: var(--muted);
  font-size: 12px;
}

.audit-row ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.usage-content {
  display: grid;
  gap: 14px;
}

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

.usage-metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.usage-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.usage-metric strong {
  font-size: 15px;
}

.usage-section {
  display: grid;
  gap: 8px;
}

.dashboard-content {
  display: grid;
  gap: 14px;
}

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

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

.dashboard-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.graph-row {
  display: grid;
  gap: 6px;
}

.graph-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.graph-row-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-row-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.graph-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.graph-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.usage-table {
  display: grid;
  gap: 6px;
}

.usage-table-head,
.usage-table-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) repeat(4, minmax(76px, 1fr));
  gap: 8px;
  align-items: center;
}

.usage-table.with-cost .usage-table-head,
.usage-table.with-cost .usage-table-row {
  grid-template-columns: minmax(170px, 1.5fr) repeat(5, minmax(76px, 1fr));
}

.usage-table-head {
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.usage-table-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12px;
}

.usage-table-row span {
  color: var(--text);
  font-weight: 700;
}

.usage-recent {
  display: grid;
  gap: 8px;
}

.review-cases-content,
.review-case-list {
  display: grid;
  gap: 14px;
}

.review-case-row {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.review-case-row small {
  color: var(--muted);
  font-size: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e5f3f1;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.tag-pill.muted {
  background: #eef1f4;
  color: var(--muted);
}

.review-case-section {
  display: grid;
  gap: 5px;
}

.review-case-section strong {
  font-size: 12px;
}

.review-case-section ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.review-case-example {
  padding: 9px;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.error-text {
  color: var(--coral);
  font-weight: 800;
}

@media (max-width: 1240px) {
  body {
    min-width: 1024px;
  }

  .workspace {
    grid-template-columns: 250px minmax(460px, 1fr) minmax(460px, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  h1 {
    font-size: 15px;
  }

  .status-strip {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .app-nav {
    display: grid;
    order: 3;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-nav-button {
    flex: 1;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .sidebar,
  .chart-panel,
  .preview-panel {
    height: auto;
    max-height: none;
  }

  .sidebar {
    max-height: 44vh;
    overflow: auto;
  }

  .chart-panel {
    overflow: visible;
  }

  .section-bar {
    padding: 12px;
  }

  .chart-header-tools {
    width: 100%;
    justify-content: stretch;
  }

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

  .chart-form {
    padding: 12px;
  }

  .field-grid,
  .therapy-grid,
  .field-grid.compact {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .span-2 {
    grid-column: auto;
  }

  .check-grid,
  .check-grid.wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .vas-row,
  .pain-toggles {
    flex-wrap: wrap;
  }

  .rom-table {
    overflow-x: auto;
  }

  .rom-head,
  .rom-row {
    min-width: 520px;
  }

  .preview-panel {
    overflow: visible;
  }

  .report-preview {
    min-height: 280px;
  }

  .preview-panel.review-active .report-preview {
    flex: none;
    min-height: 240px;
  }

  .ai-review-panel {
    flex: none;
    max-height: 42vh;
    min-height: 220px;
    overflow: auto;
  }

  .preview-panel .action-row {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .preview-panel .action-row button {
    width: 100%;
    min-width: 0;
  }

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

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

  .management-view {
    padding: 10px;
  }

  .management-panel {
    min-height: auto;
  }

  .management-tabs {
    padding: 10px;
  }

  .management-content {
    padding: 10px;
  }

  .usage-summary,
  .dashboard-summary,
  .dashboard-grid,
  .field-grid.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .usage-table,
  .usage-section {
    overflow-x: auto;
  }

  .usage-table-head,
  .usage-table-row,
  .usage-table.with-cost .usage-table-head,
  .usage-table.with-cost .usage-table-row {
    min-width: 620px;
  }
}
