:root {
  --office-bg: #eef7fb;
  --office-panel: rgba(255, 255, 255, 0.92);
  --office-line: #d8e1ea;
  --office-ink: #101828;
  --office-muted: #667085;
  --office-blue: #0365ac;
  --office-shadow: 0 18px 44px rgba(12, 38, 59, 0.13);
}

.office-suite-page {
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(3, 101, 172, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(14, 124, 102, 0.1), transparent 46%),
    var(--office-bg);
}

.office-suite-header {
  position: sticky;
  color: var(--ink);
}

.office-suite-header .brand-logo-dark {
  display: block;
}

.office-suite-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  padding: 1rem;
}

.office-suite-sidebar,
.office-suite-workspace {
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: var(--office-panel);
  box-shadow: var(--office-shadow);
  backdrop-filter: blur(18px);
}

.office-suite-sidebar {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1rem;
}

.office-suite-title h1 {
  margin: 0;
  color: var(--office-ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.office-suite-title .eyebrow {
  margin-bottom: 0.45rem;
}

.office-suite-apps {
  display: grid;
  gap: 0.65rem;
}

.office-suite-apps button {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 0.7rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--office-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.office-suite-apps button:hover,
.office-suite-apps button:focus-visible,
.office-suite-apps button.is-active {
  border-color: rgba(3, 101, 172, 0.26);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(3, 101, 172, 0.1);
  outline: none;
}

.office-suite-apps .product-icon {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border-radius: 16px;
}

.office-suite-apps .product-icon svg {
  width: 29px;
  height: 29px;
}

.office-suite-apps strong,
.office-suite-apps small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-suite-apps strong {
  color: var(--office-ink);
  font-size: 1rem;
}

.office-suite-apps small {
  color: var(--office-muted);
  font-size: 0.82rem;
}

.office-suite-actions {
  display: grid;
  gap: 0.55rem;
}

.office-create-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(3, 101, 172, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #eef9ff);
}

.office-create-card strong,
.office-create-card small,
.office-create-card label,
.office-create-card span {
  display: block;
}

.office-create-card strong {
  color: var(--office-ink);
  font-size: 0.98rem;
}

.office-create-card small,
.office-create-card label span {
  color: var(--office-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.office-create-card select,
.office-create-card input {
  width: 100%;
  min-height: 42px;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--office-ink);
  font: inherit;
  font-size: 0.92rem;
}

.office-create-card select:focus,
.office-create-card input:focus {
  border-color: rgba(3, 101, 172, 0.52);
  outline: 3px solid rgba(3, 101, 172, 0.14);
}

.office-suite-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.office-suite-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--office-line);
}

.office-tab-strip,
.office-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.office-toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.office-tab {
  display: inline-flex;
  min-width: 9rem;
  max-width: 15rem;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.45rem 0.75rem;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--office-ink);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.office-tab.is-active {
  border-color: rgba(3, 101, 172, 0.52);
  background: #eaf6ff;
}

.office-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-tab-close {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--office-muted);
  font: inherit;
  cursor: pointer;
}

.office-tab-close:hover,
.office-tab-close:focus-visible {
  background: rgba(3, 101, 172, 0.12);
  color: var(--office-blue);
  outline: none;
}

.office-frame-stage {
  position: relative;
  min-height: 520px;
  background: #f7fbff;
}

.office-bridge-status {
  display: none;
  min-height: 38px;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--office-line);
  color: var(--office-muted);
  font-size: 0.9rem;
}

.office-bridge-status.is-visible {
  display: flex;
}

.office-bridge-status.is-success {
  background: #ebfdf4;
  color: #087f5b;
}

.office-bridge-status.is-warning {
  background: #fff8e6;
  color: #9a6700;
}

.office-bridge-status.is-danger {
  background: #fff1f0;
  color: #b42318;
}

.office-frame-panel {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  min-height: 0;
}

.office-frame-panel.is-active {
  display: block;
}

.office-frame-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #ffffff;
}

.office-native-panel {
  display: grid;
  gap: 1rem;
  min-height: 100%;
  padding: 1rem;
  overflow: auto;
}

.office-picker-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.office-picker-heading h2,
.office-guard-panel h2 {
  margin: 0;
  color: var(--office-ink);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.office-crumbs,
.office-panel-actions,
.office-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.office-crumbs {
  justify-content: flex-end;
}

.office-crumbs button {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--office-blue);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 760;
  cursor: pointer;
}

.office-crumbs button:hover,
.office-crumbs button:focus-visible {
  border-color: rgba(3, 101, 172, 0.4);
  outline: none;
}

.office-bridge-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.office-bridge-summary div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(3, 101, 172, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.office-bridge-summary strong,
.office-bridge-summary span {
  display: block;
}

.office-bridge-summary strong {
  color: var(--office-ink);
  font-size: 0.92rem;
}

.office-bridge-summary span {
  margin-top: 0.2rem;
  color: var(--office-muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.office-file-list {
  display: grid;
  gap: 0.6rem;
}

.office-file-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(8rem, auto) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: #ffffff;
}

.office-file-row .product-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.office-file-copy {
  min-width: 0;
}

.office-file-copy strong,
.office-file-copy span {
  display: block;
  overflow-wrap: anywhere;
}

.office-file-copy strong {
  color: var(--office-ink);
  font-size: 0.98rem;
}

.office-file-copy span {
  margin-top: 0.2rem;
  color: var(--office-muted);
  font-size: 0.82rem;
}

.office-file-badges,
.office-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  min-width: 0;
}

.office-file-badges span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #ecfdf3;
  color: #087f5b;
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.office-empty,
.office-guard-panel {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px dashed rgba(3, 101, 172, 0.24);
  border-radius: 8px;
  background: #ffffff;
}

.office-empty strong,
.office-empty span,
.office-guard-panel p {
  display: block;
}

.office-empty span,
.office-guard-panel p {
  max-width: 58ch;
  margin: 0;
  color: var(--office-muted);
  line-height: 1.5;
}

.office-guard-panel .product-icon {
  width: 60px;
  height: 60px;
}

.office-editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 520px;
  background: #ffffff;
}

.office-editor-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--office-line);
  background: #ffffff;
}

.office-editor-meta strong,
.office-editor-meta span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-editor-meta span {
  margin-top: 0.15rem;
  color: var(--office-muted);
  font-size: 0.8rem;
}

.office-editor-shell iframe {
  min-height: 0;
}

.office-suite-shell.is-tiled .office-frame-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  overflow: auto;
}

.office-suite-shell.is-tiled .office-frame-panel {
  position: relative;
  display: block;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: #ffffff;
}

.office-suite-shell.is-tiled .office-frame-panel iframe {
  height: 100%;
  min-height: 440px;
}

@media (max-width: 980px) {
  .office-suite-shell {
    grid-template-columns: 1fr;
  }

  .office-suite-sidebar {
    gap: 0.8rem;
  }

  .office-suite-apps {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  }

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

  .office-file-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .office-file-badges,
  .office-file-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .office-suite-shell {
    padding: 0.75rem;
  }

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

  .office-toolbar-actions {
    justify-content: flex-start;
  }

  .office-picker-heading,
  .office-editor-meta {
    grid-template-columns: 1fr;
  }

  .office-crumbs {
    justify-content: flex-start;
  }

  .office-bridge-summary {
    grid-template-columns: 1fr;
  }

  .office-frame-stage,
  .office-frame-panel iframe,
  .office-editor-shell {
    min-height: 62vh;
    min-height: 62dvh;
  }

  .office-file-row {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0.65rem;
  }

  .office-file-row .product-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .office-file-badges,
  .office-file-actions {
    grid-column: 1 / -1;
  }
}
