﻿:root {
  --bg: #f5f5f7;
  --logo-bg: #f3f3f5;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d9d9de;
  --rail: #f5f5f7;
  --rail-soft: #ffffff;
  --teal: #0a8f8f;
  --blue: #0071e3;
  --red: #d93a48;
  --green: #1f8f5f;
  --amber: #b7791f;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.055);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.045);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--logo-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--logo-bg);
  backdrop-filter: blur(22px);
}

.login-screen.is-hidden {
  display: none;
}

.login-card {
  display: grid;
  gap: 22px;
  width: min(408px, 100%);
  padding: 26px;
  border: 0;
  border-radius: 26px;
  background: var(--logo-bg);
  box-shadow: none;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--logo-bg);
}

.login-brand img {
  width: min(100%, 284px);
  height: auto;
  object-fit: contain;
  animation: loginLogoReveal 720ms cubic-bezier(0.2, 0.84, 0.26, 1) both;
}

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

.login-account-preview {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px 8px 10px;
  border: 1px solid rgba(29, 29, 31, 0.075);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.76) inset;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.login-account-preview.is-switching {
  opacity: 0.72;
  transform: translateY(2px) scale(0.992);
}

.login-account-preview > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--account-color, var(--teal)) 16%, #ffffff);
  color: var(--account-color, var(--teal));
  font-size: 0.86rem;
  font-weight: 950;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.74);
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.login-account-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-account-preview strong,
.login-account-preview small {
  display: block;
}

.login-account-preview strong {
  font-size: 1rem;
  line-height: 1.15;
  transition: color 180ms ease;
}

.login-account-preview small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.login-form select,
.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  outline: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.login-form select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 24px) 21px,
    calc(100% - 18px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.login-form select:hover,
.login-form input:hover {
  border-color: rgba(29, 29, 31, 0.2);
  background-color: rgba(255, 255, 255, 0.88);
}

.login-form select:focus,
.login-form input:focus {
  border-color: rgba(0, 113, 227, 0.48);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.login-form .solid-button {
  min-height: 48px;
  margin-top: 2px;
  box-shadow: 0 10px 22px rgba(0, 113, 227, 0.16);
}

.login-form .solid-button:hover {
  box-shadow: 0 12px 26px rgba(0, 113, 227, 0.2);
}

@keyframes loginLogoReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand img {
    animation: none;
  }

  .login-account-preview,
  .login-account-preview > span,
  .login-form select,
  .login-form input {
    transition: none;
  }
}

.login-error {
  margin: 0;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 850;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

.studio-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.studio-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(245, 245, 247, 0.84);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  padding: 0 0 8px;
}

.studio-brand-logo {
  display: block;
  width: min(100%, 212px);
  height: auto;
  object-fit: contain;
}

.section-kicker,
.rail-team p {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

.rail-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-weight: 720;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.rail-link:hover,
.rail-link.active {
  border-color: rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  transform: none;
}

.rail-label {
  min-width: 0;
}

.nav-badge {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.rail-glyph {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.rail-team {
  margin-top: auto;
}

.mobile-menu-toggle {
  display: none;
}

.profile-switcher {
  display: none;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.profile-switcher select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.account-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.account-card > span,
.profile-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--account-color, var(--teal)) 16%, #ffffff);
  color: var(--account-color, var(--teal));
  font-size: 0.82rem;
  font-weight: 950;
  overflow: hidden;
}

.account-card > span img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-card strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.1;
}

.account-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.account-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.account-actions .soft-button {
  width: 100%;
}

.studio-main {
  position: relative;
  min-width: 0;
  padding: 28px 30px;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.studio-header > div:first-child {
  min-width: 0;
}

.local-mode-banner {
  margin: -8px 0 18px;
  padding: 11px 14px;
  border: 1px solid rgba(217, 119, 6, 0.26);
  border-radius: 14px;
  background: #fff7ed;
  color: #9a4b00;
  font-size: 0.82rem;
  font-weight: 850;
}

#active-week-label {
  max-width: min(640px, 70vw);
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(1.86rem, 3.4vw, 2.86rem);
  letter-spacing: 0;
  font-weight: 780;
}

h2 {
  font-size: 1.65rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.planning-actions {
  justify-content: flex-end;
}

.soft-button,
.solid-button,
.danger-button,
.state-action {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 760;
  line-height: 1;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.soft-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

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

.soft-button:hover,
.solid-button:hover,
.danger-button:hover,
.state-action:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

#reset-status.is-counting,
#reset-status.is-armed {
  border-color: rgba(217, 58, 72, 0.26);
  background: #fff2f3;
  color: #9b1f2d;
}

#reset-status.is-counting {
  cursor: wait;
  opacity: 0.82;
}

#reset-status.is-armed {
  box-shadow: 0 0 0 3px rgba(217, 58, 72, 0.08);
}

.view {
  display: none;
  animation: viewIn 260ms ease both;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-strip article,
.day-lane,
.insight-card,
.stats-command,
.stats-matrix,
.analytics-table {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.summary-strip article {
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 16px;
}

.summary-strip span,
.insight-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.summary-strip strong,
.insight-card strong {
  display: block;
  margin-top: 7px;
  font-size: 1.78rem;
  font-weight: 780;
}

.paste-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin: -4px 0 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(24, 154, 155, 0.28);
  border-radius: 16px;
  background: rgba(228, 246, 245, 0.86);
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 950;
}

.paste-bar[hidden] {
  display: none;
}

.paste-bar .soft-button {
  min-height: 32px;
  padding: 0 12px;
  background: #fff;
}

.week-control-panel {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.week-picker,
.week-note-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.week-picker select,
.week-note-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.week-nav-control {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px auto;
  gap: 8px;
  align-items: center;
}

.week-nav-control .icon-button {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: var(--ink);
  font-size: 0;
  line-height: 1;
}

.week-nav-control .icon-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-color: currentColor;
  border-style: solid;
  border-width: 2px 2px 0 0;
}

#previous-week::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

#next-week::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.week-picker select {
  appearance: none;
  min-height: 42px;
  padding: 0 38px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 16px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-today-button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.date-jump-control {
  position: absolute;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
  justify-content: stretch;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08), var(--shadow-soft);
}

.date-jump-control[hidden] {
  display: none;
}

.date-jump-digit {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 950;
  text-align: center;
}

.date-jump-control.is-invalid .date-jump-digit {
  border-color: rgba(211, 47, 47, 0.55);
  background: #fff6f6;
}

.week-note-field textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.35;
}

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

.success {
  color: var(--green);
}

.amber {
  color: var(--amber);
}

.week-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
}

.platform-board {
  align-items: start;
}

.planning-matrix {
  display: grid;
  grid-template-columns: 124px repeat(7, minmax(136px, 1fr));
  gap: 6px;
  align-items: stretch;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.matrix-corner,
.day-head,
.row-label,
.calendar-cell {
  border: 1px solid #ececf0;
  background: #fbfbfd;
}

.matrix-corner,
.day-head {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 6px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 860;
  line-height: 1;
  white-space: nowrap;
}

.row-label {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: stretch;
  gap: 7px;
  min-height: 136px;
  padding: 8px;
  border-radius: 10px;
  background: #f7f7f9;
}

.row-label small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.calendar-cell {
  position: relative;
  min-width: 0;
  min-height: 136px;
  padding: 6px;
  border-radius: 10px;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.calendar-cell.is-drop-target {
  border-color: rgba(0, 113, 227, 0.42);
  background: rgba(232, 242, 255, 0.72);
  box-shadow:
    var(--shadow-soft),
    inset 0 0 0 1px rgba(0, 113, 227, 0.18);
}

.calendar-cell:empty,
.calendar-cell.is-empty {
  background: #fdfdfd;
  box-shadow: none;
}

.calendar-cell.is-empty {
  display: block;
}

.cell-add-post {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 1px dashed rgba(110, 110, 115, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(110, 110, 115, 0.58);
  cursor: pointer;
  font-size: 0;
  font-weight: 520;
  line-height: 0;
  opacity: 0.56;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
  transform: translate(-50%, -50%);
}

.cell-add-post::before {
  content: "+";
  display: block;
  color: currentColor;
  font-size: 1.25rem;
  font-weight: 560;
  line-height: 1;
  transform: translateY(-1px);
}

.calendar-cell.is-empty:hover {
  border-color: rgba(0, 113, 227, 0.18);
  background: #f8fbff;
}

.calendar-cell.is-empty:hover .cell-add-post,
.cell-add-post:focus-visible {
  border-color: rgba(0, 113, 227, 0.3);
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.04);
}

.day-head.is-date-jump-highlight,
.calendar-cell.is-date-jump-highlight {
  border-color: rgba(46, 160, 67, 0.72);
  background: rgba(226, 246, 232, 0.92);
  box-shadow:
    0 0 0 2px rgba(46, 160, 67, 0.22),
    var(--shadow-soft);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.planning-matrix .content-card {
  display: grid;
  grid-template-rows: minmax(3.75rem, 1fr) minmax(1.4rem, auto) 30px;
  gap: 6px;
  min-height: 134px;
  margin-bottom: 0;
  padding: 18px 8px 8px;
  border-radius: 10px;
  overflow: hidden;
}

.planning-matrix .content-card + .content-card {
  margin-top: 7px;
}

.planning-matrix .content-card strong {
  display: -webkit-box;
  align-self: start;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding-right: 24px;
  font-size: clamp(0.74rem, 0.82vw, 0.9rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.planning-matrix .content-card small,
.planning-matrix .content-card footer {
  font-size: clamp(0.64rem, 0.72vw, 0.76rem);
}

.planning-matrix .content-card small {
  display: -webkit-box;
  align-self: end;
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.planning-matrix .content-card footer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 30px;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.planning-matrix .owner-chip {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: color-mix(in srgb, var(--owner-color, var(--teal)) 14%, #ffffff);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(17, 27, 33, 0.12);
}

.planning-matrix .owner-chip img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.planning-matrix .owner-chip em {
  display: none;
}

.planning-matrix .state-action {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  padding: 0 6px;
  overflow: hidden;
  font-size: clamp(0.5rem, 0.52vw, 0.58rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paste-target {
  width: 100%;
  min-height: 30px;
  margin-top: 7px;
  border: 1px dashed rgba(24, 154, 155, 0.42);
  border-radius: 12px;
  background: rgba(228, 246, 245, 0.72);
  color: var(--teal);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
}

.paste-target:hover {
  background: #e4f6f5;
}

.day-lane {
  min-height: 440px;
  padding: 12px;
  border-radius: 22px;
}

.day-lane.weekend {
  background: rgba(255, 250, 241, 0.88);
}

.day-lane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.day-lane header span {
  font-size: 1.05rem;
  font-weight: 950;
}

.day-lane header small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.content-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 126px;
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid #e6e6eb;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.content-card[draggable="true"] {
  cursor: grab;
}

.content-card.is-dragging {
  cursor: grabbing;
  opacity: 0.58;
  transform: scale(0.98);
}

.content-card.is-drop-before::before,
.content-card.is-drop-after::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  pointer-events: none;
}

.content-card.is-drop-before::before {
  top: -6px;
}

.content-card.is-drop-after::before {
  bottom: -6px;
}

.content-card:hover {
  border-color: rgba(0, 113, 227, 0.28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.045);
  transform: none;
}

.content-card strong {
  font-size: 1.02rem;
}

.content-card small,
.step-list small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.content-card footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.content-card footer .owner-chip {
  min-width: 0;
}

.content-card.is-done {
  border-color: rgba(31, 143, 95, 0.24);
  background: #fbfffd;
}

.content-card.has-note {
  border-color: rgba(0, 113, 227, 0.22);
}

.content-card.is-mine {
  border-color: color-mix(in srgb, var(--owner-color, var(--teal)) 18%, #e8e8ed);
}

.content-card.is-mine.is-done {
  border-color: rgba(31, 143, 95, 0.28);
}

.content-card.is-mine footer .owner-chip {
  border: 1px solid color-mix(in srgb, var(--owner-color, var(--teal)) 22%, transparent);
  background: color-mix(in srgb, var(--owner-color, var(--teal)) 8%, #ffffff);
  color: color-mix(in srgb, var(--owner-color, var(--teal)) 72%, #1d1d1f);
}

.content-card.has-note::after {
  content: "i";
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8f2ff;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.planning-matrix .content-card:not(.has-note)::before {
  content: none;
}

.planning-matrix .content-card.is-drop-before::before,
.planning-matrix .content-card.is-drop-after::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  pointer-events: none;
}

.planning-matrix .content-card.is-drop-before::before {
  top: -6px;
}

.planning-matrix .content-card.is-drop-after::before {
  bottom: -6px;
}

.planning-matrix .content-card.has-note strong {
  width: 100%;
  max-width: 100%;
}

.platform-pill,
.state-action,
.tool-state {
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 820;
  line-height: 1;
}

.state-action {
  width: 100%;
  min-height: 28px;
  border: 1px solid #f0c7cc;
  background: #fff2f3;
  color: #9b1f2d;
  cursor: pointer;
  display: grid;
  place-items: center;
  white-space: nowrap;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.state-action:hover {
  transform: none;
}

.content-card.is-done .state-action {
  border-color: #c8ebd7;
  background: #f0fbf5;
  color: #176a49;
}

.state-action.is-done-action {
  border-color: #c8ebd7;
  background: #f0fbf5;
  color: #176a49;
}

.platform-pill.instagram {
  background: #f2edf8;
  color: #6e3aa8;
}

.platform-pill.tiktok {
  background: #eef0f3;
  color: #111b21;
}

.platform-pill.facebook,
.platform-pill.group {
  background: #e8f2ff;
  color: #1c5da8;
}

.platform-pill.pinterest {
  background: #fff0f1;
  color: #a32835;
}

.platform-pill.linkedin {
  background: #e8f3fb;
  color: #0a66c2;
}

.platform-pill.youtube {
  background: #fff0f0;
  color: #c31924;
}

.state.open {
  background: #ffe8eb;
  color: #9e1d2b;
}

.state.progress {
  background: #fff3d7;
  color: #8a5c0f;
}

.state.done {
  background: #e3f7ec;
  color: #176a49;
}

.card-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px);
}

.card-dialog::backdrop {
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.card-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.card-form header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.card-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.card-form input,
.card-form select,
.card-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.card-form textarea {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

.last-posted-hint {
  margin: -4px 0 2px;
  padding: 9px 11px;
  border: 1px solid rgba(10, 143, 143, 0.18);
  border-radius: 11px;
  background: rgba(10, 143, 143, 0.08);
  color: #0f6f72;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.last-posted-hint[data-state="empty"] {
  border-color: rgba(109, 119, 133, 0.22);
  background: rgba(109, 119, 133, 0.08);
  color: #5d6978;
}

.detail-dialog {
  width: min(780px, calc(100vw - 32px));
}

.detail-form {
  gap: 16px;
  padding: 24px;
}

.detail-header {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-title-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.detail-title-block > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.detail-title-block h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 780;
}

#card-detail-status {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #f0c7cc;
  border-radius: 999px;
  background: #fff2f3;
  color: #9b1f2d;
  font-size: 0.74rem;
  font-weight: 820;
}

#card-detail-status.is-done {
  border-color: #c8ebd7;
  background: #f0fbf5;
  color: #176a49;
}

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

.detail-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  background: rgba(250, 250, 252, 0.72);
}

.detail-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

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

.detail-meta label,
.note-section label {
  min-width: 0;
}

.detail-form input,
.detail-form select,
.detail-form textarea {
  min-height: 46px;
  border-color: rgba(0, 0, 0, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
}

.detail-form textarea {
  min-height: 150px;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

.row-label .platform-pill {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 28px;
  padding-inline: 6px;
  text-align: center;
}

.detail-actions .state-action,
.detail-actions .danger-button,
.detail-actions .soft-button,
.detail-actions .solid-button {
  width: 100%;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: clamp(0.9rem, 1.2vw, 1.02rem);
  font-weight: 880;
  letter-spacing: 0;
  white-space: nowrap;
}

.danger-button {
  border: 1px solid rgba(227, 77, 89, 0.28);
  border-radius: 999px;
  background: #fff0f2;
  color: #b42a38;
  cursor: pointer;
  font-weight: 950;
}

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

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

.team-form {
  gap: 18px;
}

.team-list {
  display: grid;
  gap: 10px;
  max-height: min(420px, 48vh);
  overflow: auto;
  padding-right: 4px;
}

.team-account-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(120px, 1.1fr) minmax(120px, 1fr) minmax(110px, 0.72fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.team-avatar-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.team-avatar-control .avatar-remove {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0 10px;
}

.avatar-upload {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.avatar-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.team-account-row label,
.team-create label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.team-account-row input,
.team-account-row select,
.team-create input,
.team-create select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
}

.team-create {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: rgba(245, 245, 247, 0.76);
}

.team-create p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 850;
}

.team-create-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.6fr);
  gap: 10px;
}

.ideas-shell {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - 142px);
}

.ideas-list-panel,
.idea-detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.ideas-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

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

.ideas-panel-head h2,
.idea-detail-head h2 {
  font-size: 1.45rem;
}

.idea-detail-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(100%, 280px);
}

.idea-detail-tools select,
.idea-detail-tools button {
  min-height: 40px;
}

.idea-edit-toggle {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  font-weight: 950;
}

.idea-edit-toggle:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #f8fbff;
  color: var(--blue);
}

.idea-create-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 14px;
  background: #f8fbff;
}

.idea-create-form label,
.idea-edit-form label,
.idea-comment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.idea-create-form input,
.idea-create-form select,
.idea-create-form textarea,
.idea-edit-form input,
.idea-edit-form select,
.idea-edit-form textarea,
.idea-comment-form textarea,
.idea-detail-head select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
}

.idea-create-form input,
.idea-create-form select,
.idea-edit-form input,
.idea-edit-form select,
.idea-detail-head select {
  min-height: 40px;
  padding: 0 11px;
}

.idea-create-form textarea,
.idea-edit-form textarea,
.idea-comment-form textarea {
  min-height: 82px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.35;
}

.idea-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.idea-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6e6eb;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.idea-card[draggable="true"] {
  cursor: grab;
}

.idea-card.is-dragging {
  opacity: 0.54;
  cursor: grabbing;
}

.idea-card.is-drop-before::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.24);
}

.idea-card:hover,
.idea-card.active {
  border-color: rgba(0, 113, 227, 0.28);
  background: #f8fbff;
  box-shadow: var(--shadow-soft);
}

.idea-card-top,
.idea-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.idea-card-top {
  justify-content: space-between;
}

.idea-card strong,
.idea-card-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idea-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.15;
  white-space: nowrap;
}

.idea-card-top em {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
}

.idea-card-preview {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.idea-card-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.idea-card-meta span {
  min-width: 0;
}

.idea-status {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1f3;
  color: #64727a;
  font-size: 0.64rem;
  font-weight: 950;
}

.idea-status.offen {
  background: #fff7e8;
  color: #9a5e0d;
}

.idea-status.geplant {
  background: #eaf8f1;
  color: #176a49;
}

.idea-status.archiviert {
  background: #edf1f3;
  color: #64727a;
}

.ideas-empty-list,
.idea-empty-state,
.idea-no-comments {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.ideas-empty-list strong,
.idea-empty-state h2 {
  color: var(--ink);
}

.idea-detail-panel {
  display: grid;
  min-height: 0;
  padding: 16px;
}

.idea-detail {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
}

.idea-detail-note {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8f8fa;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.45;
}

.idea-edit-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 14px;
  background: #fbfdff;
}

.idea-edit-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(150px, 1.2fr);
  gap: 10px;
}

.idea-edit-actions {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.idea-schedule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(10, 143, 143, 0.14);
  border-radius: 14px;
  background: rgba(10, 143, 143, 0.06);
}

.idea-schedule-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.idea-schedule-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0;
}

.idea-chat {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 240px;
  overflow: auto;
  padding: 2px 2px 8px;
}

.idea-comment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.profile-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 0.68rem;
}

.idea-comment > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e6e6eb;
  border-radius: 13px;
  background: #ffffff;
}

.idea-comment header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.idea-comment strong {
  font-size: 0.8rem;
}

.idea-comment time {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.idea-comment p {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.idea-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.idea-comment-form textarea {
  min-height: 54px;
  max-height: 132px;
}

@media (max-width: 1400px) {
  .studio-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .studio-main {
    padding: 24px;
  }

  .planning-matrix {
    grid-template-columns: 112px repeat(7, minmax(112px, 1fr));
    gap: 6px;
    padding: 5px;
  }

  .matrix-corner,
  .day-head {
    min-height: 32px;
    border-radius: 9px;
  }

  .row-label,
  .calendar-cell {
    min-height: 126px;
    border-radius: 9px;
  }

  .row-label {
    padding: 7px;
  }

  .calendar-cell {
    padding: 5px;
  }

  .planning-matrix .content-card {
    grid-template-rows: minmax(3.3rem, 1fr) minmax(1.2rem, auto) 28px;
    min-height: 128px;
    padding: 17px 7px 7px;
  }

  .planning-matrix .content-card strong {
    font-size: clamp(0.7rem, 0.78vw, 0.86rem);
  }

  .planning-matrix .content-card small,
  .planning-matrix .content-card footer {
    font-size: 0.66rem;
  }

  .planning-matrix .state-action {
    min-height: 28px;
    padding: 0 4px;
    font-size: 0.52rem;
  }

  .content-card.has-note::after {
    top: 8px;
    right: 8px;
    width: 17px;
    height: 17px;
    font-size: 0.62rem;
  }

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

  .dashboard-source-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.stats-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 22px;
}

.refresh-panel {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 8px 12px;
  min-width: min(100%, 520px);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.refresh-panel strong {
  color: var(--ink);
}

.refresh-panel button {
  grid-row: span 2;
}

.insight-card {
  padding: 14px 16px;
  border-radius: 22px;
}

.insight-card strong {
  font-size: 1.55rem;
}

.progress-line {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeee;
}

.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.progress-line.teal i {
  background: var(--teal);
}

.progress-line.red i {
  background: var(--red);
}

#statistiken {
  height: calc(100vh - 142px);
  max-height: calc(100vh - 142px);
  overflow: hidden;
}

.stats-one-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.stats-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stats-headline h2 {
  font-size: 1.25rem;
}

.refresh-chip {
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.refresh-chip strong {
  color: var(--ink);
}

.refresh-chip .soft-button {
  min-height: 32px;
  padding: 0 12px;
}

.stats-mode {
  align-self: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf1f3;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.stats-mode.is-partial {
  background: #fff3d7;
  color: #8a5c0f;
}

.stats-mode.is-live {
  background: #e3f7ec;
  color: #176a49;
}

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

.stats-kpi-line article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stats-kpi-line span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.stats-kpi-line strong {
  font-size: 1.25rem;
  line-height: 1;
}

.stats-kpi-line article > small {
  align-self: start;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.stats-kpi-line i {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeee;
}

.stats-kpi-line i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.stats-kpi-line article:nth-child(2) i b {
  background: var(--amber);
}

.stats-kpi-line article:nth-child(3) i b {
  background: var(--green);
}

.stats-matrix {
  display: grid;
  overflow: auto;
  border-radius: 22px;
  min-height: 0;
}

.matrix-row {
  display: grid;
  grid-template-columns: minmax(95px, 0.8fr) repeat(7, minmax(82px, 1fr));
  align-items: center;
  gap: 10px;
  min-width: 760px;
  min-height: 58px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.matrix-row > * {
  min-width: 0;
  text-align: center;
}

.matrix-row > *:first-child {
  text-align: left;
}

.matrix-row:first-child {
  border-top: 0;
}

.matrix-head {
  background: var(--rail);
  color: #fff;
  font-weight: 900;
}

.matrix-row > span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.matrix-head > span:first-child {
  color: #d7e6e3;
}

.matrix-row b {
  font-size: 1rem;
  line-height: 1;
}

.stat-cell {
  display: grid;
  gap: 2px;
  justify-items: center;
  line-height: 1.05;
}

.stat-cell strong {
  font-size: 0.98rem;
}

.stat-cell em,
.stats-kpi-line article > small {
  font-style: normal;
}

.stat-cell em {
  font-size: 0.69rem;
  font-weight: 950;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.neutral {
  color: var(--muted) !important;
}

.matrix-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.25;
}

.marketing-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  min-height: 0;
}

.marketing-dashboard-grid article,
.dashboard-source {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.marketing-dashboard-grid span,
.dashboard-source span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.marketing-dashboard-grid strong {
  font-size: 1.35rem;
  line-height: 1;
}

.marketing-dashboard-grid small,
.dashboard-source small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  line-height: 1.3;
}

.dashboard-source-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  min-height: 0;
}

.dashboard-source strong {
  font-size: 0.86rem;
}

.analytics-table {
  overflow: hidden;
  border-radius: 22px;
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr 0.55fr 0.9fr 2fr;
  gap: 14px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.analytics-row:first-child {
  border-top: 0;
}

.analytics-row.head {
  background: var(--rail);
  color: #fff;
  font-weight: 900;
}

@media (max-width: 1160px) {
  body {
    background: #ffffff;
  }

  .studio-shell {
    grid-template-columns: 1fr;
  }

  .studio-shell {
    min-height: 100vh;
  }

  .studio-main {
    padding: 12px 10px 18px;
  }

  .ideas-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ideas-list-panel,
  .idea-detail-panel {
    border-radius: 14px;
  }

  .ideas-list-panel {
    max-height: none;
  }

  .ideas-list {
    max-height: 42vh;
  }

  .idea-detail {
    min-height: 520px;
  }

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

  .idea-detail-tools {
    justify-content: stretch;
    min-width: 0;
  }

  .idea-detail-tools select,
  .idea-detail-tools button {
    flex: 1 1 132px;
  }

  .idea-edit-grid,
  .idea-edit-actions,
  .idea-schedule-form {
    grid-template-columns: 1fr;
  }

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

  .studio-rail {
    position: static;
    top: auto;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(78px, 96px) minmax(0, 1fr) 38px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.055);
    backdrop-filter: blur(14px);
  }

  .brand-lockup {
    min-height: 0;
    padding: 0;
    justify-content: flex-start;
  }

  .studio-brand-logo {
    width: 88px;
    max-height: 36px;
    object-fit: contain;
  }

  .rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .rail-link {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 34px;
    padding: 6px 7px;
    border-radius: 9px;
    font-size: 0.74rem;
    text-align: center;
  }

  .rail-glyph {
    display: none;
  }

  .rail-team {
    display: contents;
  }

  .account-card {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 30px;
    gap: 0;
    width: 36px;
    height: 34px;
    margin: 0;
    padding: 2px;
    border-radius: 10px;
  }

  .account-card > span {
    width: 30px;
    height: 30px;
    font-size: 0.68rem;
  }

  .account-card div,
  .account-actions,
  #open-team-admin,
  #logout-button,
  .profile-switcher {
    display: none !important;
  }

  .studio-header {
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  #active-week-label {
    max-width: 100%;
    font-size: 0.64rem;
  }

  h1 {
    font-size: 1.56rem;
  }

  .week-control-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .week-picker,
  .week-note-field {
    gap: 6px;
    padding: 9px;
    border-radius: 12px;
    font-size: 0.68rem;
  }

  .week-nav-control {
    grid-template-columns: 34px minmax(0, 1fr) 34px auto;
    gap: 6px;
  }

  .week-nav-control .icon-button {
    width: 34px;
    height: 34px;
  }

  .week-picker select {
    min-height: 36px;
    padding-left: 10px;
    font-size: 0.72rem;
  }

  .week-today-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .date-jump-control {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .date-jump-digit {
    width: 100%;
    min-height: 30px;
    font-size: 0.9rem;
  }

  .week-note-field textarea {
    min-height: 46px;
    max-height: 92px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
  }

  .summary-strip article {
    min-height: 56px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .summary-strip span {
    font-size: 0.64rem;
  }

  .summary-strip strong {
    margin-top: 4px;
    font-size: 1.22rem;
  }

  .planning-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .matrix-corner,
  .day-head {
    display: none;
  }

  .row-label {
    min-height: auto;
    margin-top: 8px;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: stretch;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 12px;
    background: #f4f5f7;
  }

  .row-label:first-of-type {
    margin-top: 0;
  }

  .row-label small {
    text-align: right;
  }

  .calendar-cell {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
    min-height: 54px;
    padding: 7px;
    border-radius: 12px;
    background: #ffffff;
  }

  .calendar-cell:empty,
  .calendar-cell.is-empty {
    grid-template-columns: 60px minmax(0, 1fr) 34px;
    min-height: 42px;
    background: #fbfbfd;
  }

  .calendar-cell::before {
    content: attr(data-day-label);
    display: grid;
    place-items: center;
    min-height: 100%;
    margin: 0;
    border-radius: 9px;
    background: #f0f1f4;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 950;
  }

  .calendar-cell.is-empty::after {
    content: attr(data-platform);
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-cell .cell-add-post {
    position: static;
    justify-self: end;
    align-self: center;
    grid-column: 3;
    grid-row: 1;
    width: 30px;
    height: 30px;
    opacity: 0.9;
    transform: none;
  }

  .calendar-cell.is-empty:hover .cell-add-post,
  .cell-add-post:focus-visible {
    transform: none;
  }

  .planning-matrix .content-card {
    grid-column: 2;
    grid-template-rows: auto auto auto;
    gap: 5px;
    min-height: 78px;
    padding: 10px;
    border-radius: 11px;
  }

  .planning-matrix .content-card strong {
    padding-right: 22px;
    font-size: 0.88rem;
    line-height: 1.16;
    -webkit-line-clamp: 2;
  }

  .planning-matrix .content-card small,
  .planning-matrix .content-card footer {
    font-size: 0.7rem;
  }

  .planning-matrix .content-card footer {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-content: space-between;
  }

  .planning-matrix .state-action {
    min-height: 26px;
    font-size: 0.58rem;
  }

  .platform-pill {
    max-width: 100%;
    padding-inline: 7px;
    font-size: 0.64rem;
  }
}

@media (max-width: 760px) {
  .marketing-dashboard-grid,
  .dashboard-source-list {
    grid-template-columns: 1fr;
  }

  body {
    background: #ffffff;
  }

  .studio-main,
  .studio-rail {
    padding: 12px;
  }

  .studio-shell {
    min-height: 100vh;
  }

  .studio-rail {
    position: static;
    top: auto;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(84px, 108px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.055);
  }

  .brand-lockup {
    min-height: 0;
    padding: 0;
    justify-content: flex-start;
  }

  .studio-brand-logo {
    width: 96px;
    max-height: 40px;
  }

  .rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-link {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 0.78rem;
    text-align: center;
  }

  .rail-glyph {
    display: none;
  }

  .rail-team {
    display: contents;
  }

  .account-card {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 32px;
    gap: 0;
    width: 42px;
    height: 38px;
    margin: 0;
    padding: 3px;
    border-radius: 12px;
  }

  .account-card > span {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }

  .account-card div,
  .account-actions,
  #open-team-admin,
  #logout-button,
  .profile-switcher {
    display: none !important;
  }

  .studio-main {
    padding-top: 14px;
  }

  .studio-header,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-header {
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  #active-week-label {
    max-width: 100%;
    font-size: 0.66rem;
  }

  h1 {
    font-size: 1.62rem;
  }

  .planning-actions {
    position: static;
    margin-bottom: 12px;
  }

  .summary-strip,
  .week-control-panel,
  .week-board,
  .tool-launcher,
  .stats-grid,
  .stats-kpi-line,
  .refresh-chip {
    grid-template-columns: 1fr;
  }

  .week-control-panel {
    gap: 8px;
    margin-bottom: 10px;
  }

  .week-picker,
  .week-note-field {
    gap: 6px;
    padding: 9px;
    border-radius: 12px;
    font-size: 0.68rem;
  }

  .week-nav-control {
    grid-template-columns: 34px minmax(0, 1fr) 34px auto;
    gap: 6px;
  }

  .week-nav-control .icon-button {
    width: 34px;
    height: 34px;
  }

  .week-picker select {
    min-height: 36px;
    padding-left: 10px;
    font-size: 0.72rem;
  }

  .week-today-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .date-jump-control {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .date-jump-digit {
    width: 100%;
    min-height: 30px;
    font-size: 0.9rem;
  }

  .week-note-field textarea {
    min-height: 46px;
    max-height: 96px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
  }

  .summary-strip article {
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .summary-strip span {
    font-size: 0.66rem;
  }

  .summary-strip strong {
    margin-top: 4px;
    font-size: 1.25rem;
  }

  .detail-dialog {
    width: min(100vw - 18px, 780px);
  }

  .detail-form {
    padding: 18px;
  }

  .detail-title-block > div,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid.two,
  .detail-actions,
  .team-create-grid,
  .team-account-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 22px;
    border-radius: 22px;
  }

  .login-brand {
    align-items: center;
    flex-direction: column;
  }

  .team-account-row {
    align-items: stretch;
  }

  .planning-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .matrix-corner,
  .day-head {
    display: none;
  }

  .row-label {
    min-height: auto;
    margin-top: 8px;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: stretch;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 12px;
    background: #f4f5f7;
  }

  .row-label:first-of-type {
    margin-top: 0;
  }

  .row-label small {
    text-align: right;
  }

  .calendar-cell {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
    min-height: 54px;
    padding: 7px;
    border-radius: 12px;
    background: #ffffff;
  }

  .calendar-cell:empty,
  .calendar-cell.is-empty {
    grid-template-columns: 60px minmax(0, 1fr) 34px;
    min-height: 42px;
    background: #fbfbfd;
  }

  .calendar-cell::before {
    content: attr(data-day-label);
    display: grid;
    place-items: center;
    min-height: 100%;
    margin: 0;
    border-radius: 9px;
    background: #f0f1f4;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 950;
  }

  .calendar-cell.is-empty::after {
    content: attr(data-platform);
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-cell .cell-add-post {
    position: static;
    justify-self: end;
    align-self: center;
    grid-column: 3;
    grid-row: 1;
    width: 30px;
    height: 30px;
    opacity: 0.9;
    transform: none;
  }

  .calendar-cell.is-empty:hover .cell-add-post,
  .cell-add-post:focus-visible {
    transform: none;
  }

  .planning-matrix .content-card {
    grid-column: 2;
    grid-template-rows: auto auto auto;
    gap: 5px;
    min-height: 78px;
    padding: 10px;
    border-radius: 11px;
  }

  .planning-matrix .content-card strong {
    padding-right: 22px;
    font-size: 0.88rem;
    line-height: 1.16;
    -webkit-line-clamp: 2;
  }

  .planning-matrix .content-card small,
  .planning-matrix .content-card footer {
    font-size: 0.7rem;
  }

  .planning-matrix .content-card footer {
    grid-template-columns: 24px minmax(92px, 132px);
    justify-content: space-between;
  }

  .planning-matrix .state-action {
    min-height: 26px;
    font-size: 0.58rem;
  }

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

  .stats-command,
  .refresh-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .day-lane {
    min-height: auto;
  }

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

body.mobile-compact {
  background: #ffffff;
}

body.mobile-compact .studio-shell {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

body.mobile-compact .studio-rail {
  position: static !important;
  top: auto !important;
  z-index: auto;
  display: grid;
  grid-template-columns: minmax(74px, 90px) minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-right: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body.mobile-compact .brand-lockup {
  min-height: 0;
  padding: 0;
  justify-content: flex-start;
}

body.mobile-compact .studio-brand-logo {
  width: 82px;
  max-height: 32px;
  object-fit: contain;
}

body.mobile-compact .rail-nav {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body.mobile-compact .rail-link {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 32px;
  padding: 5px 6px;
  border-radius: 9px;
  font-size: 0.7rem;
  text-align: center;
}

body.mobile-compact .rail-glyph {
  display: none;
}

body.mobile-compact .rail-team {
  display: contents;
}

body.mobile-compact .account-card {
  grid-column: 3;
  grid-row: 1;
  grid-template-columns: 28px;
  gap: 0;
  width: 34px;
  height: 32px;
  margin: 0;
  padding: 2px;
  border-radius: 9px;
}

body.mobile-compact .account-card > span {
  width: 28px;
  height: 28px;
  font-size: 0.64rem;
}

body.mobile-compact .account-card div,
body.mobile-compact .account-actions,
body.mobile-compact #open-team-admin,
body.mobile-compact #logout-button,
body.mobile-compact .profile-switcher {
  display: none !important;
}

body.mobile-compact .studio-main {
  padding: 10px 9px 18px;
}

body.mobile-compact .studio-header {
  gap: 7px;
  margin-bottom: 9px;
  padding-bottom: 9px;
}

body.mobile-compact #active-week-label {
  max-width: 100%;
  font-size: 0.62rem;
}

body.mobile-compact h1 {
  font-size: 1.48rem;
}

body.mobile-compact .week-control-panel {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 9px;
}

body.mobile-compact .week-picker,
body.mobile-compact .week-note-field {
  gap: 5px;
  padding: 8px;
  border-radius: 11px;
  font-size: 0.66rem;
}

body.mobile-compact .week-nav-control {
  grid-template-columns: 32px minmax(0, 1fr) 32px auto;
  gap: 6px;
}

body.mobile-compact .week-nav-control .icon-button {
  width: 32px;
  height: 32px;
}

body.mobile-compact .week-picker select {
  min-height: 34px;
  padding-left: 9px;
  font-size: 0.7rem;
}

body.mobile-compact .week-today-button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.66rem;
}

body.mobile-compact .date-jump-control {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

body.mobile-compact .date-jump-digit {
  width: 100%;
  min-height: 28px;
  font-size: 0.86rem;
}

body.mobile-compact .week-note-field textarea {
  min-height: 42px;
  max-height: 88px;
  padding: 7px 9px;
  font-size: 0.76rem;
}

body.mobile-compact .summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}

body.mobile-compact .summary-strip article {
  min-height: 52px;
  padding: 7px 8px;
  border-radius: 11px;
}

body.mobile-compact .summary-strip span {
  font-size: 0.62rem;
}

body.mobile-compact .summary-strip strong {
  margin-top: 3px;
  font-size: 1.16rem;
}

body.mobile-compact .planning-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.mobile-compact .matrix-corner,
body.mobile-compact .day-head {
  display: none;
}

body.mobile-compact .row-label {
  min-height: auto;
  margin-top: 8px;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: stretch;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 11px;
  background: #f4f5f7;
}

body.mobile-compact .row-label:first-of-type {
  margin-top: 0;
}

body.mobile-compact .row-label small {
  text-align: right;
}

body.mobile-compact .calendar-cell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
  min-height: 52px;
  padding: 6px;
  border-radius: 11px;
  background: #ffffff;
}

body.mobile-compact .calendar-cell:empty,
body.mobile-compact .calendar-cell.is-empty {
  grid-template-columns: 56px minmax(0, 1fr) 32px;
  min-height: 40px;
  background: #fbfbfd;
}

body.mobile-compact .calendar-cell::before {
  content: attr(data-day-label);
  display: grid;
  place-items: center;
  min-height: 100%;
  margin: 0;
  border-radius: 8px;
  background: #f0f1f4;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 950;
}

body.mobile-compact .calendar-cell.is-empty::after {
  content: attr(data-platform);
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-compact .calendar-cell .cell-add-post {
  position: static;
  justify-self: end;
  align-self: center;
  grid-column: 3;
  grid-row: 1;
  width: 28px;
  height: 28px;
  opacity: 0.9;
  transform: none;
}

body.mobile-compact .calendar-cell.is-empty:hover .cell-add-post,
body.mobile-compact .cell-add-post:focus-visible {
  transform: none;
}

body.mobile-compact .planning-matrix .content-card {
  grid-column: 2;
  grid-template-rows: auto auto auto;
  gap: 5px;
  min-height: 74px;
  padding: 9px;
  border-radius: 10px;
}

body.mobile-compact .planning-matrix .content-card strong {
  padding-right: 21px;
  font-size: 0.84rem;
  line-height: 1.16;
  -webkit-line-clamp: 2;
}

body.mobile-compact .planning-matrix .content-card small,
body.mobile-compact .planning-matrix .content-card footer {
  font-size: 0.68rem;
}

body.mobile-compact .planning-matrix .content-card footer {
  grid-template-columns: 26px minmax(0, 1fr);
  justify-content: space-between;
}

body.mobile-compact .planning-matrix .state-action {
  min-height: 25px;
  font-size: 0.56rem;
}

body.mobile-compact .studio-rail {
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  padding: 7px 10px;
}

body.mobile-compact .brand-lockup {
  justify-content: flex-start;
}

body.mobile-compact .studio-brand-logo {
  width: 76px;
  max-height: 30px;
}

body.mobile-compact .mobile-menu-toggle {
  display: grid;
  grid-template-rows: repeat(3, 2px);
  align-content: center;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

body.mobile-compact .mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

body.mobile-compact .rail-nav,
body.mobile-compact .rail-team {
  display: none !important;
}

body.mobile-compact.mobile-menu-open .rail-nav,
body.mobile-compact.mobile-menu-open .rail-team {
  display: grid !important;
  grid-column: 1 / -1;
}

body.mobile-compact.mobile-menu-open .rail-nav {
  grid-template-columns: 1fr;
  gap: 6px;
  padding-top: 8px;
}

body.mobile-compact.mobile-menu-open .rail-link {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  justify-items: start;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.82rem;
  text-align: left;
}

body.mobile-compact.mobile-menu-open .rail-glyph {
  display: block;
}

body.mobile-compact.mobile-menu-open .rail-team {
  gap: 7px;
  margin-top: 0;
  padding-top: 2px;
}

body.mobile-compact.mobile-menu-open .account-card {
  display: grid;
  grid-column: 1 / -1;
  grid-row: auto;
  grid-template-columns: 34px minmax(0, 1fr);
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 7px 9px;
}

body.mobile-compact.mobile-menu-open .account-card > span {
  width: 34px;
  height: 34px;
}

body.mobile-compact.mobile-menu-open .account-card div {
  display: block !important;
}

body.mobile-compact.mobile-menu-open .account-actions {
  display: grid !important;
  grid-column: 1 / -1;
  gap: 7px;
  margin-top: 0;
}

body.mobile-compact.mobile-menu-open #open-team-admin,
body.mobile-compact.mobile-menu-open #logout-button {
  display: inline-grid !important;
  min-height: 36px;
}

@media (max-width: 1160px), (pointer: coarse) and (max-width: 1366px) {
  .studio-rail {
    position: static !important;
    top: auto !important;
    z-index: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    box-shadow: none;
    backdrop-filter: none;
  }

  .brand-lockup {
    min-height: 0;
    padding: 0;
    justify-content: flex-start;
  }

  .studio-brand-logo {
    width: 76px;
    max-height: 30px;
  }

  .mobile-menu-toggle {
    display: grid;
    grid-template-rows: repeat(3, 2px);
    align-content: center;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }

  .rail-nav,
  .rail-team {
    display: none !important;
  }

  body.mobile-menu-open .rail-nav,
  body.mobile-menu-open .rail-team {
    display: grid !important;
    grid-column: 1 / -1;
  }

  body.mobile-menu-open .rail-nav {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 8px;
  }

  body.mobile-menu-open .rail-link {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    justify-items: start;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.82rem;
    text-align: left;
  }

  body.mobile-menu-open .rail-glyph {
    display: block;
  }

  body.mobile-menu-open .rail-team {
    gap: 7px;
    margin-top: 0;
  }

  body.mobile-menu-open .account-card {
    display: grid;
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: 34px minmax(0, 1fr);
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 7px 9px;
  }

  body.mobile-menu-open .account-card > span {
    width: 34px;
    height: 34px;
  }

  body.mobile-menu-open .account-card div {
    display: block !important;
  }

  body.mobile-menu-open .account-actions {
    display: grid !important;
    grid-column: 1 / -1;
    gap: 7px;
    margin-top: 0;
  }

  body.mobile-menu-open #open-team-admin,
  body.mobile-menu-open #logout-button {
    display: inline-grid !important;
    min-height: 36px;
  }
}
