/* Material Design 3 semantic tokens */
:root {
  color-scheme: dark;
  --md-sys-color-primary: #8db8ff;
  --md-sys-color-on-primary: #002e6b;
  --md-sys-color-primary-container: #0d47a1;
  --md-sys-color-on-primary-container: #d9e8ff;
  --md-sys-color-secondary: #b7c7e2;
  --md-sys-color-on-secondary: #17263d;
  --md-sys-color-secondary-container: #293b59;
  --md-sys-color-on-secondary-container: #dce8ff;
  --md-sys-color-tertiary: #9fd7ff;
  --md-sys-color-on-tertiary: #00344f;
  --md-sys-color-tertiary-container: #145878;
  --md-sys-color-on-tertiary-container: #c5e8ff;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-surface: #0d1420;
  --md-sys-color-surface-dim: #0d1420;
  --md-sys-color-surface-bright: #35445a;
  --md-sys-color-surface-container-lowest: #080d15;
  --md-sys-color-surface-container-low: #131e2d;
  --md-sys-color-surface-container: #192638;
  --md-sys-color-surface-container-high: #24344a;
  --md-sys-color-surface-container-highest: #30435c;
  --md-sys-color-on-surface: #e4edff;
  --md-sys-color-on-surface-variant: #becbe0;
  --md-sys-color-outline: #8999b2;
  --md-sys-color-outline-variant: #3d506a;
  --md-sys-color-inverse-surface: #e4edff;
  --md-sys-color-inverse-on-surface: #263448;
  --md-sys-color-inverse-primary: #185abc;
  --md-sys-color-scrim: #000;
  --md-sys-color-shadow: #000;
  --md-sys-color-success: #a6dba8;
  --md-sys-color-success-container: #1e4e2a;
  --md-sys-color-on-success-container: #c2f1c4;

  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 999px;

  --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-sys-elevation-2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-sys-elevation-3: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
  --md-motion-standard: cubic-bezier(.2, 0, 0, 1);
  --md-motion-emphasized: cubic-bezier(.2, 0, 0, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --md-sys-color-primary: #0d5bd7;
  --md-sys-color-on-primary: #fff;
  --md-sys-color-primary-container: #d7e6ff;
  --md-sys-color-on-primary-container: #002b66;
  --md-sys-color-secondary: #50627d;
  --md-sys-color-on-secondary: #fff;
  --md-sys-color-secondary-container: #dce7f8;
  --md-sys-color-on-secondary-container: #17243a;
  --md-sys-color-tertiary: #176b99;
  --md-sys-color-on-tertiary: #fff;
  --md-sys-color-tertiary-container: #c5e8ff;
  --md-sys-color-on-tertiary-container: #00344f;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #fff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-surface: #f8faff;
  --md-sys-color-surface-dim: #d9e1ed;
  --md-sys-color-surface-bright: #f8faff;
  --md-sys-color-surface-container-lowest: #fff;
  --md-sys-color-surface-container-low: #f1f5fc;
  --md-sys-color-surface-container: #ebf1fa;
  --md-sys-color-surface-container-high: #e2eaf6;
  --md-sys-color-surface-container-highest: #d9e3f1;
  --md-sys-color-on-surface: #172235;
  --md-sys-color-on-surface-variant: #4a5a72;
  --md-sys-color-outline: #73839b;
  --md-sys-color-outline-variant: #c1ccdb;
  --md-sys-color-success: #256a36;
  --md-sys-color-success-container: #a8f5b5;
  --md-sys-color-on-success-container: #002108;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body:not(.is-authenticated) .app-shell { visibility: hidden; }
.auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--md-sys-color-surface) 94%, transparent); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(100%, 480px); padding: 32px; display: grid; gap: 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-icon { width: 48px; height: 48px; }
.auth-copy { display: grid; gap: 8px; }
.auth-copy h1, .auth-copy p { margin: 0; }
.auth-copy p { color: var(--md-sys-color-on-surface-variant); }
.auth-form { display: grid; gap: 12px; }
.auth-form .m3-button { min-height: 48px; }
.auth-form .field-result { margin: 0; }
body.is-authenticated .auth-gate { display: none; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: "Roboto Flex", Roboto, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
}
button, textarea, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

/* M3 type scale */
.display-small { font-size: 36px; line-height: 44px; font-weight: 400; letter-spacing: 0; }
.headline-medium { font-size: 28px; line-height: 36px; font-weight: 400; letter-spacing: 0; }
.title-large { font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: 0; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .1px; }
.body-large { font-size: 16px; line-height: 24px; font-weight: 400; letter-spacing: .5px; }
.body-medium { font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: .25px; }
.body-small { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: .4px; }
.label-large { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .1px; }
.label-medium { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .5px; }
.label-small { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .5px; }

.app-shell { min-height: 100vh; display: flex; }
.navigation-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 320px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border-right: 1px solid var(--md-sys-color-outline-variant);
}
.drawer-brand {
  min-height: 56px;
  padding: 4px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-brand > div { display: grid; }
.drawer-brand .body-small { color: var(--md-sys-color-on-surface-variant); }
.brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  font-variation-settings: "FILL" 1;
}
.drawer-create { margin: 4px 12px 24px; align-self: flex-start; }
.drawer-nav { display: grid; gap: 4px; }
.drawer-label { padding: 0 16px 8px; color: var(--md-sys-color-on-surface-variant); }
.nav-item {
  position: relative;
  min-height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  overflow: hidden;
}
.nav-item::before, .m3-button::before, .m3-icon-button::before, .m3-chip::before, .bottom-nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity 150ms var(--md-motion-standard);
  pointer-events: none;
}
.nav-item:hover::before, .m3-button:hover::before, .m3-icon-button:hover::before, .m3-chip:hover::before, .bottom-nav-item:hover::before { opacity: .08; }
.nav-item:active::before, .m3-button:active::before, .m3-icon-button:active::before, .m3-chip:active::before, .bottom-nav-item:active::before { opacity: .12; }
.nav-item.selected {
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
}
.nav-item.selected .material-symbols-rounded:first-child { font-variation-settings: "FILL" 1; }
.nav-item .label-large { flex: 1; }
.nav-badge {
  min-width: 24px;
  padding: 2px 6px;
  text-align: center;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
}
.nav-trailing { font-size: 18px; }
.drawer-footer { margin-top: auto; padding: 12px; }
.workspace-tile { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.workspace-tile > div { display: grid; }
.workspace-tile .body-small { color: var(--md-sys-color-on-surface-variant); }
.status-indicator, .service-state {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
}
.status-indicator { box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-outline) 16%, transparent); }
.status-indicator.offline { background: var(--md-sys-color-error); }
.privacy-note { display: flex; align-items: center; gap: 8px; color: var(--md-sys-color-on-surface-variant); }
.privacy-note .material-symbols-rounded { font-size: 18px; }

.app-content { width: calc(100% - 320px); min-height: 100vh; margin-left: 320px; }
.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 8px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--md-sys-color-surface) 92%, transparent);
  backdrop-filter: blur(16px);
}
.top-app-title { display: flex; align-items: center; gap: 12px; }
.top-app-title > div { display: grid; }
.top-app-title .body-small { color: var(--md-sys-color-on-surface-variant); }
.mobile-brand { display: none; color: var(--md-sys-color-primary); }
.top-app-actions { display: flex; align-items: center; gap: 8px; }
.avatar-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.main-content { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 40px 0 64px; }
.welcome-section {
  min-height: 236px;
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  overflow: hidden;
}
.section-kicker { color: var(--md-sys-color-primary); }
.welcome-section .section-kicker { color: var(--md-sys-color-on-primary-container); opacity: .78; }
.welcome-section h1 { max-width: 640px; margin: 8px 0 12px; }
.welcome-copy { max-width: 640px; margin: 0; opacity: .86; }
.workflow-graphic { display: flex; align-items: center; flex: 0 0 auto; }
.workflow-node {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 50%;
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  box-shadow: var(--md-sys-elevation-1);
}
.workflow-node .material-symbols-rounded { font-size: 28px; }
.workflow-node--primary {
  width: 100px;
  height: 100px;
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
}
.workflow-node--primary .material-symbols-rounded { font-variation-settings: "FILL" 1; }
.workflow-line { width: 24px; height: 2px; background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 38%, transparent); }

.service-overview { margin: 24px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.service-card {
  min-height: 80px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container);
}
.service-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
}
.service-card > div { flex: 1; display: grid; }
.service-card .body-small { color: var(--md-sys-color-on-surface-variant); }
.service-state.online {
  background: var(--md-sys-color-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-success) 16%, transparent);
}

/* Material components */
.m3-card { border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container); }
.m3-card--elevated { background: var(--md-sys-color-surface-container-low); box-shadow: var(--md-sys-elevation-1); }
.m3-card--outlined { border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface); }
.m3-card--tonal { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.m3-button {
  position: relative;
  min-height: 40px;
  width: fit-content;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: .1px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 200ms var(--md-motion-standard);
}
.m3-button .material-symbols-rounded { font-size: 18px; }
.m3-button--filled { color: var(--md-sys-color-on-primary); background: var(--md-sys-color-primary); }
.m3-button--tonal { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.m3-button--outlined { color: var(--md-sys-color-primary); background: transparent; border: 1px solid var(--md-sys-color-outline); }
.m3-button--text { padding: 0 12px; color: var(--md-sys-color-primary); background: transparent; }
.m3-button:hover { box-shadow: var(--md-sys-elevation-1); }
.m3-button--text:hover, .m3-button--outlined:hover { box-shadow: none; }
.m3-icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.m3-icon-button--filled { color: var(--md-sys-color-on-primary); background: var(--md-sys-color-primary); }
.m3-chip {
  position: relative;
  min-height: 32px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: .1px;
  cursor: pointer;
  overflow: hidden;
}
.m3-chip .material-symbols-rounded { font-size: 18px; }

.assistant-card { overflow: hidden; }
.card-header, .section-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.card-header h2, .card-header p, .section-header h2, .section-header p { margin: 0; }
.card-header p, .section-header p { color: var(--md-sys-color-on-surface-variant); }
.messages { min-height: 220px; max-height: 460px; padding: 8px 24px 20px; overflow-y: auto; }
.message { max-width: 800px; margin: 0 0 16px; display: flex; align-items: flex-start; gap: 12px; }
.message-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}
.message-icon .material-symbols-rounded { font-size: 20px; font-variation-settings: "FILL" 1; }
.message-bubble {
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-high);
}
.message p { margin: 0 0 6px; white-space: pre-wrap; }
.message p:last-of-type { margin-bottom: 8px; }
.message-time { color: var(--md-sys-color-on-surface-variant); }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.message.user .message-icon { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.message.user .message-bubble {
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large);
}
.assistive-chips { padding: 0 24px 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.message-composer { padding: 8px 24px 0; display: flex; align-items: center; gap: 12px; }
.m3-text-field {
  position: relative;
  min-height: 56px;
  display: block;
  flex: 1;
  border-radius: var(--md-sys-shape-corner-extra-small);
  color: var(--md-sys-color-on-surface);
}
.m3-text-field--outlined { border: 1px solid var(--md-sys-color-outline); background: transparent; }
.m3-text-field:hover { border-color: var(--md-sys-color-on-surface); }
.m3-text-field:focus-within { border: 2px solid var(--md-sys-color-primary); }
.m3-text-field textarea, .m3-text-field input {
  width: 100%;
  height: 100%;
  min-height: 54px;
  padding: 18px 16px 8px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: .5px;
}
.m3-text-field select {
  width: 100%;
  min-height: 54px;
  padding: 18px 40px 8px 16px;
  border: 0;
  outline: 0;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}
.m3-text-field select + .floating-label { top: -10px; font-size: 12px; line-height: 20px; }
.m3-text-field input { padding-right: 48px; }
.floating-label {
  position: absolute;
  left: 12px;
  top: 17px;
  padding: 0 4px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface);
  font-size: 16px;
  line-height: 22px;
  pointer-events: none;
  transition: transform 150ms var(--md-motion-standard), color 150ms, font-size 150ms;
  transform-origin: left center;
}
.assistant-card .floating-label { background: var(--md-sys-color-surface-container-low); }
.m3-text-field:focus-within .floating-label,
.m3-text-field textarea:not(:placeholder-shown) + .floating-label,
.m3-text-field input:not(:placeholder-shown) + .floating-label {
  top: -10px;
  color: var(--md-sys-color-primary);
  font-size: 12px;
  line-height: 20px;
}
.field-trailing { position: absolute; right: 14px; top: 16px; color: var(--md-sys-color-on-surface-variant); }
.send-button { flex: 0 0 auto; }

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.message-composer.is-loading .send-button .material-symbols-rounded {
  animation: m3-spin 800ms linear infinite;
}

@keyframes m3-spin {
  to { transform: rotate(360deg); }
}
.field-support { padding: 6px 24px 20px; display: flex; justify-content: space-between; color: var(--md-sys-color-on-surface-variant); }

.content-section, .channels-section, .settings-section { padding-top: 40px; scroll-margin-top: 64px; }
.content-section > .section-header, .channels-section > .section-header, .settings-section > .section-header { padding: 0 0 20px; }
.empty-state {
  min-height: 280px;
  padding: 48px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-low);
}
.empty-state[hidden] { display: none; }
.empty-icon { font-size: 48px; color: var(--md-sys-color-primary); }
.empty-state h3 { margin: 16px 0 4px; }
.empty-state p { max-width: 440px; margin: 0 0 20px; color: var(--md-sys-color-on-surface-variant); }
.drafts-list { display: grid; gap: 16px; }
.draft-card {
  padding: 24px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
}
.draft-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.draft-header h3 { margin: 6px 0 4px; font-size: 22px; line-height: 28px; font-weight: 500; }
.platform-tag, .draft-status {
  width: fit-content;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .5px;
}
.platform-tag { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); text-transform: capitalize; }
.draft-status { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-high); }
.status-approved { color: var(--md-sys-color-on-success-container); background: var(--md-sys-color-success-container); }
.status-sent-to-postiz, .status-published { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); }
.status-scheduled { color: var(--md-sys-color-on-success-container); background: var(--md-sys-color-success-container); }
.draft-objective { margin: 0 0 24px; color: var(--md-sys-color-on-surface-variant); }
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--md-sys-color-primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .5px;
}
.draft-copy { margin: 0 0 12px; white-space: pre-wrap; font-size: 16px; line-height: 24px; letter-spacing: .5px; }
.draft-hashtags { margin: 0 0 24px; color: var(--md-sys-color-primary); font-size: 14px; line-height: 20px; }
.draft-details { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.draft-details > div { padding: 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.draft-details p { margin: 0; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 20px; }
.visual-output { max-width: 420px; margin-top: 16px; padding: 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.visual-output.is-carousel { max-width: none; }
.visual-gallery { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
.visual-output.is-carousel .visual-gallery { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.visual-gallery figure { min-width: 0; margin: 0; }
.visual-output img { display: block; width: 100%; max-height: 520px; object-fit: contain; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container); }
.visual-gallery figcaption { margin-top: 6px; color: var(--md-sys-color-on-surface-variant); }
.visual-output .body-small { display: block; margin-top: 8px; color: var(--md-sys-color-on-surface-variant); }
.carousel-outline { margin-top: 12px; padding: 16px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-medium); }
.carousel-outline-list { margin: 10px 0 0; padding-left: 24px; color: var(--md-sys-color-on-surface-variant); }
.carousel-outline-list li { margin: 7px 0; line-height: 20px; }
.draft-actions { margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reel-audio-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.draft-actions audio { max-width: 320px; height: 36px; }
.reel-preview { width: min(100%, 320px); max-height: 560px; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container); object-fit: contain; }
.draft-delete-button { margin-left: auto; color: var(--md-sys-color-error); }
.draft-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
}
.draft-edit-form[hidden] { display: none; }
.draft-edit-form .m3-text-field { width: 100%; }
.draft-edit-form .m3-text-field:nth-child(n+3),
.draft-edit-form .draft-edit-actions { grid-column: 1 / -1; }
.draft-edit-form .carousel-slides-field { grid-column: 1 / -1; }
.draft-edit-form select {
  width: 100%;
  min-height: 54px;
  padding: 18px 16px 8px;
  border: 0;
  outline: 0;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  font-size: 16px;
}
.draft-edit-form .draft-platform-field .floating-label,
.draft-edit-form .draft-select-field .floating-label {
  top: -10px;
  color: var(--md-sys-color-primary);
  font-size: 12px;
  line-height: 20px;
}
.draft-edit-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.integration-select {
  min-height: 40px;
  min-width: 260px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
}
.schedule-date {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
}
.postiz-link { color: var(--md-sys-color-primary); text-decoration: none; font-weight: 600; }
.draft-meta { display: block; margin-top: 16px; color: var(--md-sys-color-on-surface-variant); }
.calendar-section { padding-top: 40px; scroll-margin-top: 64px; }
.calendar-section > .section-header { padding: 0 0 20px; }
.calendar-generator { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.calendar-generator .m3-text-field { flex: 1; }
.calendar-generator .m3-button { flex: 0 0 auto; }
.calendar-section .field-result { min-height: 20px; margin: 0 0 16px; }
.calendars-list { display: grid; gap: 16px; }
.calendar-card {
  padding: 24px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
}
.calendar-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.calendar-header h3 { margin: 6px 0 12px; }
.calendar-strategy { margin: 0 0 20px; color: var(--md-sys-color-on-surface-variant); }
.calendar-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calendar-item { padding: 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.calendar-item-header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.calendar-date { color: var(--md-sys-color-primary); }
.calendar-item h4 { margin: 14px 0 8px; }
.calendar-item p { margin: 0 0 10px; }
.calendar-item-objective, .calendar-item-cta { color: var(--md-sys-color-on-surface-variant); }
.calendar-item-copy { white-space: pre-wrap; font-size: 14px; line-height: 20px; }
.calendar-item-hashtags { color: var(--md-sys-color-primary); font-size: 13px; line-height: 18px; }
.feed-preview-block { max-width: 360px; margin-top: 20px; padding: 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.feed-preview-block p { margin: 10px 0 0; color: var(--md-sys-color-on-surface-variant); }
.feed-preview-image { display: block; width: 100%; margin-top: 10px; border-radius: var(--md-sys-shape-corner-small); }
.instagram-feed-section { padding-top: 40px; scroll-margin-top: 64px; }
.instagram-feed-section > .section-header { padding: 0 0 20px; }
.instagram-profile-preview { max-width: 720px; padding: 24px; }
.instagram-profile-header { display: flex; align-items: center; gap: 14px; }
.instagram-profile-avatar { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--md-sys-color-on-primary); background: linear-gradient(135deg, #f58529, #dd2a7b 48%, #8134af 78%, #515bd4); }
.instagram-profile-avatar .material-symbols-rounded { font-size: 28px; }
.instagram-profile-copy { min-width: 0; display: grid; gap: 3px; }
.instagram-profile-copy .title-large { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instagram-profile-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 7px 10px; border-radius: 999px; color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); white-space: nowrap; }
.instagram-profile-badge .material-symbols-rounded { font-size: 16px; }
.instagram-profile-stats { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0 16px; color: var(--md-sys-color-on-surface-variant); }
.instagram-profile-stats strong { color: var(--md-sys-color-on-surface); }
.instagram-feed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: hidden; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container-low); }
.instagram-feed-tile { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; border: 0; color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-high); cursor: pointer; }
.instagram-feed-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease, filter 180ms ease; }
.instagram-feed-tile:hover img, .instagram-feed-tile:focus-visible img { transform: scale(1.035); filter: brightness(.82); }
.instagram-feed-tile:focus-visible { outline: 3px solid var(--md-sys-color-primary); outline-offset: -3px; z-index: 1; }
.instagram-feed-tile-number { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: white; background: rgb(0 0 0 / 55%); font-size: 11px; font-weight: 700; }
.instagram-feed-carousel-badge { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 999px; color: white; background: rgb(0 0 0 / 58%); font-size: 11px; font-weight: 700; }
.instagram-feed-carousel-badge .material-symbols-rounded { font-size: 15px; }
.instagram-feed-tile.is-pending { display: flex; flex-direction: column; gap: 8px; padding: 18px; text-align: center; background: var(--md-sys-color-surface-container-low); }
.instagram-feed-tile.is-pending .material-symbols-rounded { font-size: 30px; color: var(--md-sys-color-primary); }
.instagram-feed-pending-label { font-size: 12px; line-height: 16px; }
.instagram-feed-section .empty-state { margin-top: 16px; }
.calendar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.calendar-progress { margin-right: auto; color: var(--md-sys-color-on-surface-variant); }
.analytics-section { padding-top: 40px; scroll-margin-top: 64px; }
.analytics-section > .section-header { padding: 0 0 20px; }
.analytics-importer { display: flex; align-items: center; gap: 12px; }
.analytics-file-field { flex: 1; }
.analytics-help { margin: 8px 0; color: var(--md-sys-color-on-surface-variant); }
.analytics-section .field-result { min-height: 20px; margin: 0 0 16px; }
.instagram-live-card { margin: 20px 0 24px; padding: 20px; }
.instagram-live-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.instagram-live-header h3, .instagram-live-header p { margin: 0; }
.instagram-live-header p { margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.instagram-live-controls { display: grid; grid-template-columns: 1fr 240px; gap: 12px; margin-top: 20px; }
.instagram-performance { display: grid; gap: 10px; margin-top: 16px; }
.instagram-performance-summary { display: flex; flex-wrap: wrap; gap: 8px; color: var(--md-sys-color-on-surface-variant); }
.instagram-post-row { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface); }
.instagram-post-copy { min-width: 0; display: grid; gap: 4px; }
.instagram-post-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instagram-post-meta { color: var(--md-sys-color-on-surface-variant); }
.instagram-post-metrics { display: flex; flex-wrap: wrap; gap: 10px; color: var(--md-sys-color-on-surface-variant); }
.instagram-post-row.is-poor { border-color: var(--md-sys-color-error); background: color-mix(in srgb, var(--md-sys-color-error-container) 35%, var(--md-sys-color-surface)); }
.instagram-post-row.is-poor .instagram-post-meta { color: var(--md-sys-color-on-error-container); }
.instagram-post-action { white-space: nowrap; }
.instagram-performance-empty { padding: 18px; color: var(--md-sys-color-on-surface-variant); border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-medium); }
.analytics-report[hidden] { display: none; }
.analytics-report-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; color: var(--md-sys-color-on-surface-variant); }
.analytics-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.analytics-metric { min-height: 124px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.analytics-metric strong { display: block; margin: 8px 0; }
.analytics-metric .label-large { color: var(--md-sys-color-on-surface-variant); }
.analytics-change { color: var(--md-sys-color-on-surface-variant); }
.analytics-change.is-positive { color: var(--md-sys-color-success); }
.analytics-change.is-negative { color: var(--md-sys-color-error); }
.analytics-block { margin-top: 16px; padding: 20px; border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container-low); }
.analytics-block h3 { margin: 0 0 14px; }
.analytics-table { width: 100%; border-collapse: collapse; }
.analytics-table th, .analytics-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.analytics-table th { color: var(--md-sys-color-on-surface-variant); }
.analytics-table tr:last-child td { border-bottom: 0; }
.analytics-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analytics-top-list, .analytics-recommendations { margin: 0; padding-left: 22px; }
.analytics-top-list li, .analytics-recommendations li { padding: 6px 0; color: var(--md-sys-color-on-surface-variant); }
.analytics-top-list li { display: flex; flex-direction: column; gap: 2px; }
.analytics-top-list strong { color: var(--md-sys-color-on-surface); }
.draft-image-spec { display: block; margin-top: 8px; color: var(--md-sys-color-on-surface-variant); }
.draft-kit-state { margin-top: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-radius: var(--md-sys-shape-corner-small); }
.draft-kit-state .material-symbols-rounded { font-size: 19px; }
.draft-kit-state.is-ready { color: var(--md-sys-color-on-success-container); background: var(--md-sys-color-success-container); }
.draft-kit-state.is-warning { color: var(--md-sys-color-on-error-container); background: var(--md-sys-color-error-container); }

.channels-notice {
  min-height: 72px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.channels-notice[hidden] { display: none; }
.channels-notice > .material-symbols-rounded { font-size: 28px; }
.channels-notice h3, .channels-notice p { margin: 0; }
.channels-notice p { margin-top: 2px; opacity: .82; }
.channels-notice-copy { align-self: start; }
.channels-activation-form { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.channels-activation-form .m3-button { min-height: 48px; }
.channels-activation-form .field-result { grid-column: 1 / -1; margin: 0; }
.evolution-card { margin-top: 20px; padding: 24px; }
.evolution-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.evolution-header h3, .evolution-header p { margin: 0; }
.evolution-header h3 { margin-top: 4px; }
.evolution-header p { max-width: 720px; margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.evolution-content { display: flex; align-items: center; gap: 28px; margin-top: 20px; }
.evolution-qr-frame { width: 220px; min-width: 220px; height: 220px; display: grid; place-items: center; border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-large); background: #fff; color: #4a454e; text-align: center; padding: 12px; }
.evolution-qr-frame img { display: block; width: 196px; height: 196px; object-fit: contain; }
.evolution-actions { display: grid; gap: 10px; align-items: start; }
.evolution-actions p { margin: 0; }
.evolution-actions .m3-button { justify-self: start; }
.evolution-actions .field-result { color: var(--md-sys-color-on-surface-variant); }
.channel-block { margin-top: 20px; padding: 24px; border-radius: var(--md-sys-shape-corner-extra-large); background: var(--md-sys-color-surface-container-low); }
.channel-block-title { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.channel-block-title h3, .channel-block-title p { margin: 0; }
.channel-block-title p { margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.connected-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.connected-channel {
  min-height: 88px;
  padding: 16px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
}
.channel-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.connected-channel-copy { min-width: 0; display: grid; }
.connected-channel-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connected-channel-copy .body-small { color: var(--md-sys-color-on-surface-variant); }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--md-sys-color-success); }
.connection-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.compact-empty {
  min-height: 88px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-large);
  color: var(--md-sys-color-on-surface-variant);
}
.compact-empty[hidden] { display: none; }
.compact-empty > .material-symbols-rounded { font-size: 30px; color: var(--md-sys-color-primary); }
.compact-empty > div { display: grid; }
.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.provider-card {
  position: relative;
  min-height: 116px;
  padding: 16px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.provider-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 150ms var(--md-motion-standard); }
.provider-card:hover::before { opacity: .08; }
.provider-card:active::before { opacity: .12; }
.provider-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--md-sys-shape-corner-medium); color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.provider-card-copy { min-width: 0; display: grid; gap: 2px; }
.provider-card-copy .body-small { color: var(--md-sys-color-on-surface-variant); }
.provider-card-action { grid-column: 2; display: inline-flex; align-items: center; gap: 5px; color: var(--md-sys-color-primary); }
.provider-card-action .material-symbols-rounded { font-size: 18px; }
.provider-card.is-connected { border-color: var(--md-sys-color-primary); }
.provider-card.is-connected .provider-card-action { color: var(--md-sys-color-success); }
.channel-result { min-height: 20px; margin: 16px 0 0; color: var(--md-sys-color-on-surface-variant); }
.channel-result.is-error { color: var(--md-sys-color-error); }
.channel-result.is-success { color: var(--md-sys-color-success); }

.brand-kit-card { padding: 24px; }
.brand-kit-header { display: flex; align-items: flex-start; gap: 16px; }
.brand-kit-header h3, .brand-kit-header p { margin: 0; }
.brand-kit-header p { margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.brand-upload-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.brand-upload-form { min-width: 0; padding: 16px; display: grid; align-content: start; gap: 6px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container-low); }
.brand-upload-form > .body-small { min-height: 32px; color: var(--md-sys-color-on-surface-variant); }
.m3-file-field { min-height: 56px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-medium); color: var(--md-sys-color-on-surface-variant); cursor: pointer; }
.m3-file-field:hover { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-surface-container); }
.m3-file-field .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.m3-file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.brand-upload-form .m3-button { margin-top: 8px; width: 100%; }
.brand-upload-status { min-height: 20px; color: var(--md-sys-color-on-surface-variant); }
.brand-profile-block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.brand-profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; color: var(--md-sys-color-primary); }
.brand-profile-heading p { max-width: 720px; margin: 4px 0 0; color: var(--md-sys-color-on-surface-variant); }
.brand-profile-form { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.brand-profile-form .m3-text-field:nth-child(n+3) { grid-column: 1 / -1; }
.brand-profile-form textarea { min-height: 88px; padding-top: 16px; resize: vertical; }
.brand-profile-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-profile-actions .field-result { margin: 0; }
.company-profile-card { margin-top: 16px; padding: 24px; }
.company-profile-card .brand-profile-heading h3 { margin: 4px 0 0; color: var(--md-sys-color-on-surface); }
.company-profile-card .brand-profile-heading p { max-width: 760px; }
.company-profile-form { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.company-profile-form .m3-text-field:nth-child(n+3) { grid-column: 1 / -1; }
.company-profile-form textarea { min-height: 88px; padding-top: 16px; resize: vertical; }
.company-profile-form .brand-profile-actions { grid-column: 1 / -1; }
.brand-assets-list { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.brand-asset { min-width: 0; padding: 12px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container); }
.brand-asset-preview { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: var(--md-sys-shape-corner-small); color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }
.brand-asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.brand-asset-copy { min-width: 0; display: grid; }
.brand-asset-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-asset-copy .body-small { color: var(--md-sys-color-on-surface-variant); }
.brand-assets-empty { margin: 16px 0 0; color: var(--md-sys-color-on-surface-variant); }
.brand-assets-empty.is-hidden { display: none; }
.brand-assets-guidance { margin: 12px 0 0; color: var(--md-sys-color-on-surface-variant); }
.brand-asset-delete { width: 36px; height: 36px; }

.settings-card { min-height: 176px; padding: 24px; display: grid; grid-template-columns: auto 1fr minmax(360px, .85fr); align-items: start; gap: 20px; }
.settings-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}
.settings-copy h3 { margin: 0 0 8px; }
.settings-copy p { margin: 0; color: var(--md-sys-color-on-surface-variant); }
.settings-actions { display: grid; gap: 12px; justify-items: start; }
.m3-segmented-button { min-height: 40px; display: inline-flex; }
.m3-segmented-button button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-right: 0;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
}
.m3-segmented-button button:first-child { border-radius: var(--md-sys-shape-corner-full) 0 0 var(--md-sys-shape-corner-full); }
.m3-segmented-button button:last-child { border-right: 1px solid var(--md-sys-color-outline); border-radius: 0 var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0; }
.m3-segmented-button button.selected { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.m3-segmented-button button.selected::before { content: "✓"; margin-right: 8px; }
.postiz-account-form { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.postiz-account-form > :nth-child(3) { grid-column: 1 / -1; }
.postiz-account-form > .m3-button { grid-column: 1 / -1; justify-self: start; }
.postiz-account-form [hidden] { display: none; }
.key-form { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.key-form .m3-text-field { width: 100%; }
.field-result { min-height: 16px; color: var(--md-sys-color-on-surface-variant); }
.advanced-settings { width: 100%; padding-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.advanced-settings summary { width: fit-content; padding: 8px 0; color: var(--md-sys-color-primary); cursor: pointer; }
.advanced-settings-content { padding-top: 8px; display: grid; gap: 12px; }
.app-footer { padding: 24px 24px 36px; text-align: center; color: var(--md-sys-color-on-surface-variant); }
.bottom-navigation { display: none; }

@media (max-width: 1180px) {
  .navigation-drawer { width: 256px; }
  .app-content { width: calc(100% - 256px); margin-left: 256px; }
  .workflow-node { width: 68px; height: 68px; }
  .workflow-node--primary { width: 80px; height: 80px; }
  .settings-card { grid-template-columns: auto 1fr; }
  .settings-actions { grid-column: 2; width: 100%; }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .navigation-drawer { display: none; }
  .app-content { width: 100%; margin-left: 0; padding-bottom: 80px; }
  .top-app-bar { padding: 8px 16px; }
  .mobile-brand { display: inline-block; }
  .main-content { width: min(100% - 32px, 760px); padding-top: 20px; }
  .welcome-section { padding: 28px; min-height: auto; }
  .workflow-graphic { display: none; }
  .bottom-navigation {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    height: 80px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: flex;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container);
  }
  .bottom-navigation::-webkit-scrollbar { display: none; }
  .bottom-nav-item {
    position: relative;
    min-width: 76px;
    flex: 1 0 76px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border-radius: var(--md-sys-shape-corner-large);
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    overflow: hidden;
  }
  .bottom-nav-item .material-symbols-rounded { width: 64px; height: 32px; display: grid; place-items: center; border-radius: var(--md-sys-shape-corner-full); }
  .bottom-nav-item.selected { color: var(--md-sys-color-on-surface); }
  .bottom-nav-item.selected .material-symbols-rounded { background: var(--md-sys-color-secondary-container); font-variation-settings: "FILL" 1; }
}

@media (max-width: 640px) {
  .display-small { font-size: 32px; line-height: 40px; }
  .headline-medium { font-size: 24px; line-height: 32px; }
  .top-app-title .body-small { display: none; }
  .main-content { width: calc(100% - 24px); }
  .welcome-section { padding: 24px; border-radius: var(--md-sys-shape-corner-large); }
  .auth-gate { padding: 12px; }
  .auth-card { padding: 24px; }
  .service-overview { grid-template-columns: 1fr; }
  .service-card { min-height: 64px; }
  .card-header, .section-header { padding: 20px; }
  .messages { padding: 4px 16px 16px; }
  .assistive-chips { padding: 0 16px 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .assistive-chips::-webkit-scrollbar { display: none; }
  .m3-chip { flex: 0 0 auto; }
  .message-composer { padding: 8px 16px 0; gap: 8px; }
  .field-support { padding: 6px 16px 16px; }
  .field-support > :first-child { display: none; }
  .field-support { justify-content: flex-end; }
  .content-section, .channels-section, .settings-section, .instagram-feed-section, .calendar-section, .analytics-section { padding-top: 32px; }
  .content-section > .section-header, .channels-section > .section-header, .settings-section > .section-header, .instagram-feed-section > .section-header, .calendar-section > .section-header, .analytics-section > .section-header { padding: 0 4px 16px; }
  .channels-section > .section-header { flex-wrap: wrap; gap: 8px; }
  .draft-card { padding: 20px; }
  .draft-header { flex-direction: column; }
  .draft-details { grid-template-columns: 1fr; }
  .draft-edit-form { grid-template-columns: 1fr; }
  .draft-edit-form .m3-text-field:nth-child(n+3), .draft-edit-form .draft-edit-actions { grid-column: 1; }
  .calendar-generator { align-items: stretch; flex-direction: column; }
  .calendar-generator .m3-button { width: 100%; }
  .calendar-card { padding: 20px; }
  .calendar-items { grid-template-columns: 1fr; }
  .instagram-profile-preview { padding: 16px; }
  .instagram-profile-header { align-items: flex-start; flex-wrap: wrap; }
  .instagram-profile-badge { margin-left: 0; }
  .instagram-profile-stats { gap: 10px 16px; font-size: 12px; }
  .analytics-importer { align-items: stretch; flex-direction: column; }
  .analytics-importer .m3-button { width: 100%; }
  .instagram-live-card { padding: 16px; }
  .instagram-live-header { flex-direction: column; }
  .instagram-live-header .m3-button { width: 100%; }
  .instagram-live-controls { grid-template-columns: 1fr; }
  .instagram-post-row { grid-template-columns: 1fr; }
  .instagram-post-action { justify-self: start; }
  .analytics-report-header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-columns { grid-template-columns: 1fr; gap: 0; }
  .analytics-block { padding: 16px; }
  .analytics-table { font-size: 12px; }
  .analytics-table th, .analytics-table td { padding: 8px 4px; }
  .schedule-date { min-width: 100%; width: 100%; }
  .integration-select { min-width: 100%; width: 100%; }
  .settings-card { grid-template-columns: 1fr; padding: 20px; }
  .settings-actions { grid-column: 1; }
  .key-form { grid-template-columns: 1fr; }
  .key-form .m3-button { width: 100%; }
  .postiz-account-form { grid-template-columns: 1fr; }
  .postiz-account-form > :nth-child(3), .postiz-account-form > .m3-button { grid-column: 1; }
  .postiz-account-form > .m3-button { width: 100%; }
  .channels-activation-form { grid-column: 1; grid-template-columns: 1fr; }
  .channels-activation-form .field-result { grid-column: 1; }
  .channels-activation-form .m3-button { grid-column: 1; width: 100%; }
  .brand-profile-form { grid-template-columns: 1fr; }
  .brand-profile-form .m3-text-field:nth-child(n+3) { grid-column: 1; }
  .brand-profile-actions { grid-column: 1; }
  .company-profile-form { grid-template-columns: 1fr; }
  .company-profile-form .m3-text-field:nth-child(n+3) { grid-column: 1; }
  .company-profile-form .brand-profile-actions { grid-column: 1; }
  .m3-segmented-button { width: 100%; }
  .m3-segmented-button button { flex: 1; padding: 0 10px; }
  .channels-notice { grid-template-columns: auto 1fr; }
  .channels-notice .m3-button { grid-column: 2; }
  .channels-activation-form { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evolution-card { padding: 20px; }
  .evolution-content { align-items: flex-start; gap: 20px; }
  .channel-block { padding: 20px; border-radius: var(--md-sys-shape-corner-large); }
  .connected-channels, .provider-grid { grid-template-columns: 1fr; }
  .evolution-content { flex-direction: column; }
  .evolution-qr-frame { width: 220px; }
  .connected-channel { grid-template-columns: 48px minmax(0, 1fr); }
  .connection-state { grid-column: 2; }
  .brand-kit-card { padding: 20px; }
  .brand-upload-grid, .brand-assets-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.meta-ads-section { padding-top: 40px; scroll-margin-top: 64px; }
.growth-section { padding-top: 40px; scroll-margin-top: 64px; }
.growth-section > .section-header { padding: 0 0 20px; }
.growth-summary { margin: 16px 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.growth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.growth-card { padding: 24px; min-width: 0; }
.growth-card h3 { margin: 0; }
.growth-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.growth-card-heading p { margin: 4px 0 0; color: var(--md-sys-color-on-surface-variant); }
.growth-policy-help { margin: 6px 0 0; color: var(--md-sys-color-on-surface-variant); }
.growth-policy-form { margin-top: 16px; display: grid; gap: 10px; }
.growth-policy-form .m3-button { justify-self: start; }
.growth-accounts { margin-top: 16px; display: grid; gap: 10px; }
.growth-account { padding: 14px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.growth-account-title { display: flex; justify-content: space-between; gap: 12px; }
.growth-account-title span { color: var(--md-sys-color-primary); }
.growth-account p { margin: 6px 0 0; color: var(--md-sys-color-on-surface-variant); }
.growth-account-error { color: var(--md-sys-color-error) !important; }
.growth-account-metrics { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.growth-recommendations { margin: 16px 0 0; padding-left: 24px; color: var(--md-sys-color-on-surface-variant); }
.growth-recommendations li + li { margin-top: 10px; }
.growth-priority { display: inline-block; min-width: 52px; margin-right: 4px; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--md-sys-color-primary); }
.growth-priority.high { color: var(--md-sys-color-error); }
.growth-priority.low { color: var(--md-sys-color-on-surface-variant); }
.growth-safety { margin: 16px 4px 0; color: var(--md-sys-color-on-surface-variant); }
.growth-comments { margin-top: 16px; display: grid; gap: 10px; }
.growth-comment { padding: 12px 14px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.growth-comment.is-replied { opacity: .72; }
.growth-comment-body { display: grid; gap: 4px; }
.growth-comment-body p, .growth-comment-body span { margin: 0; color: var(--md-sys-color-on-surface-variant); }
.growth-comment-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.growth-comment-editor { width: 100%; min-height: 64px; padding: 10px; resize: vertical; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-small); color: var(--md-sys-color-on-surface); background: var(--md-sys-color-surface); font: inherit; }
.growth-comments-empty { padding: 12px; color: var(--md-sys-color-on-surface-variant); }

@media (max-width: 840px) {
  .growth-section { padding-top: 32px; }
  .growth-grid { grid-template-columns: 1fr; }
  .growth-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .growth-card { padding: 20px; }
  .growth-card-heading { flex-direction: column; }
  .growth-card-heading .m3-button { width: 100%; }
}
.meta-ads-section > .section-header { padding: 0 0 20px; }
.meta-ads-notice { min-height: 72px; padding: 16px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.meta-ads-notice > .material-symbols-rounded { font-size: 30px; color: var(--md-sys-color-primary); }
.meta-ads-notice h3, .meta-ads-notice p { margin: 0; }
.meta-ads-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.meta-ads-card { min-width: 0; padding: 24px; }
.meta-ads-card-header h3, .meta-ads-card-header p { margin: 0; }
.meta-ads-card-header p { margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.meta-ads-form { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meta-ads-form .meta-ads-checkbox, .meta-ads-form > .m3-button { grid-column: 1 / -1; }
.meta-ads-checkbox { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--md-sys-color-on-surface-variant); font-size: 13px; line-height: 18px; }
.meta-ads-checkbox input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--md-sys-color-primary); }
.meta-ads-controls { margin-top: 20px; display: flex; align-items: end; gap: 12px; }
.meta-ads-controls .m3-text-field { min-width: 0; flex: 1; }
.meta-ads-summary { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.meta-ads-summary .analytics-metric { min-height: 96px; padding: 14px; }
.meta-ads-summary .analytics-metric strong { font-size: 18px; line-height: 24px; }
.meta-ads-campaigns { margin-top: 16px; display: grid; gap: 8px; }
.meta-ads-campaign { padding: 12px 14px; display: grid; gap: 4px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.meta-ads-campaign-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meta-ads-campaign-title span { color: var(--md-sys-color-success); }
.meta-ads-campaign-creative { margin-top: 12px; padding-top: 12px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.meta-ads-campaign-image { width: 112px; height: 140px; object-fit: cover; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container); }
.meta-ads-campaign-copy { min-width: 0; display: grid; align-content: start; gap: 5px; }
.meta-ads-campaign-copy .field-label { color: var(--md-sys-color-primary); }
.meta-ads-campaign-copy strong, .meta-ads-campaign-copy p { margin: 0; }
.meta-ads-campaign-copy p { color: var(--md-sys-color-on-surface-variant); white-space: pre-wrap; }
.meta-ads-campaign-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-ads-delete { color: var(--md-sys-color-error); }
.meta-ads-budget-input { width: 120px; min-height: 40px; padding: 0 10px; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-small); color: var(--md-sys-color-on-surface); background: var(--md-sys-color-surface); }
.meta-ads-recommendations { margin-top: 16px; }
.meta-ads-recommendation-list { margin: 0; padding: 12px 16px 12px 32px; border-radius: var(--md-sys-shape-corner-medium); color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-low); }
.meta-ads-recommendation-list li + li { margin-top: 6px; }
.meta-ads-empty { padding: 16px; border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-medium); color: var(--md-sys-color-on-surface-variant); }
.meta-ads-ab { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.meta-ads-ab-form { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.meta-ads-ab-form .m3-button { justify-self: start; }
.meta-ads-ab-list { margin-top: 16px; display: grid; gap: 10px; }
.meta-ads-ab-item { padding: 14px; display: grid; gap: 6px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); }
.meta-ads-ab-item p { margin: 0; color: var(--md-sys-color-on-surface-variant); }
.meta-ads-ab-variants { display: grid; gap: 3px; padding: 8px 0; }
.meta-ads-ab-variants span { color: var(--md-sys-color-on-surface); }

@media (max-width: 840px) {
  .meta-ads-section { padding-top: 32px; }
  .meta-ads-section > .section-header { padding: 0 4px 16px; }
  .meta-ads-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .meta-ads-campaign-creative { grid-template-columns: 88px minmax(0, 1fr); }
  .meta-ads-campaign-image { width: 88px; height: 110px; }
}

@media (max-width: 640px) {
  .meta-ads-card { padding: 20px; }
  .meta-ads-form { grid-template-columns: 1fr; }
  .meta-ads-form .meta-ads-checkbox, .meta-ads-form > .m3-button { grid-column: 1; }
  .meta-ads-form > .m3-button, .meta-ads-controls .m3-button { width: 100%; }
  .meta-ads-ab-form { grid-template-columns: 1fr; }
  .meta-ads-controls { align-items: stretch; flex-direction: column; }
  .meta-ads-campaign-actions { align-items: stretch; flex-direction: column; }
  .meta-ads-budget-input { width: 100%; }
  .meta-ads-summary { grid-template-columns: 1fr 1fr; }
  .meta-ads-notice { padding: 16px; grid-template-columns: auto 1fr; }
  .meta-ads-notice .m3-button { grid-column: 2; justify-self: start; }
}
