:root {
  color-scheme: light;
  --ink: #231f20;
  --muted: #746e70;
  --line: #e7e1df;
  --line-strong: #d6cfcc;
  --cream: #f8f4ef;
  --paper: #ffffff;
  --wine: #7a233b;
  --wine-dark: #5e172d;
  --wine-soft: #f6e9ed;
  --green: #25744b;
  --green-soft: #e9f5ee;
  --blue: #1268b3;
  --blue-soft: #e8f3ff;
  --status-gray: #59626b;
  --status-gray-soft: #f0f1f2;
  --amber: #9b5b13;
  --amber-soft: #fff3df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 1px 2px rgba(35, 31, 32, 0.06), 0 4px 16px rgba(35, 31, 32, 0.04);
  --shadow-lg: 0 24px 80px rgba(35, 31, 32, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(122, 35, 59, 0.24);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

.hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--wine), #a84762);
  box-shadow: 0 10px 24px rgba(122, 35, 59, 0.22);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.brand-mark-small {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 13px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--wine);
  box-shadow: 0 8px 18px rgba(122, 35, 59, 0.18);
}

.button-primary:hover {
  background: var(--wine-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: #fff;
}

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

.button-danger {
  border-color: #f2c3bd;
  color: var(--danger);
  background: var(--danger-soft);
}

.button-block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.text-button,
.small-action,
.table-title {
  border: 0;
  cursor: pointer;
  background: transparent;
}

.text-button {
  color: var(--wine);
  font-weight: 750;
}

.small-action {
  border-radius: 8px;
  padding: 5px 7px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 750;
}

.small-action:hover {
  background: var(--wine-soft);
}

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

.danger-action:hover {
  background: var(--danger-soft);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
}

.alert-error {
  border: 1px solid #f2c3bd;
  color: #8a1c14;
  background: var(--danger-soft);
}

label {
  display: grid;
  gap: 6px;
  color: #4f494b;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #aaa2a4;
}

/* Login */

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(122, 35, 59, 0.10), transparent 26rem),
    radial-gradient(circle at 85% 85%, rgba(181, 137, 99, 0.12), transparent 24rem),
    var(--cream);
}

.login-shell {
  width: min(100%, 430px);
}

.login-card {
  border: 1px solid rgba(214, 207, 204, 0.8);
  border-radius: 24px;
  padding: 36px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
}

.login-card .brand-mark {
  margin-bottom: 24px;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 32px;
}

.stack-form {
  display: grid;
  gap: 17px;
  margin-top: 25px;
}

/* Admin shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid #3a3033;
  padding: 22px 15px 16px;
  color: #fff;
  background: #241d1f;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand small {
  margin-top: 2px;
  color: #bfb4b7;
  font-size: 12px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 7px;
  color: #bfb4b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-heading .icon-button {
  width: 29px;
  height: 29px;
  border-color: #554a4d;
  color: #fff;
  background: #33292c;
  font-size: 18px;
}

.brand-list {
  display: grid;
  gap: 5px;
  overflow-y: auto;
}

.brand-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  border-radius: 12px;
}

.brand-row:hover,
.brand-row.active {
  background: #3b3033;
}

.brand-row.active {
  box-shadow: inset 3px 0 var(--wine);
}

.brand-item {
  display: flex;
  min-width: 0;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  padding: 9px;
  cursor: pointer;
  color: #ded7d9;
  background: transparent;
  text-align: left;
}

.brand-row:hover .brand-item,
.brand-row.active .brand-item {
  color: #fff;
}

.brand-manage {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0 0 7px;
  cursor: pointer;
  color: #bfb4b7;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

.brand-manage:hover,
.brand-manage:focus-visible {
  color: #fff;
  background: #59464c;
}

.brand-initial {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #59464c;
  font-size: 12px;
  font-weight: 850;
}

.brand-row.active .brand-initial {
  background: var(--wine);
}

.brand-item-label {
  min-width: 0;
}

.brand-item-label strong,
.brand-item-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-item-label strong {
  font-size: 13px;
}

.brand-item-label small {
  margin-top: 2px;
  color: #aa9fa2;
  font-size: 11px;
}

.logout-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid #3a3033;
  padding: 15px 7px 0;
}

.user-label {
  color: #bfb4b7;
  font-size: 12px;
}

.logout-form .text-button {
  color: #fff;
  font-size: 12px;
}

.main-panel {
  min-width: 0;
  padding: 30px clamp(20px, 4vw, 54px) 60px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
}

.topbar-actions {
  display: flex;
  gap: 9px;
}

.empty-state {
  display: grid;
  min-height: 55vh;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.empty-state h2 {
  margin: 12px 0 4px;
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 30px;
}

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  background: #fff;
}

.segment {
  min-width: 96px;
  border: 0;
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

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

.summary {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.content-table th:nth-child(1) {
  width: 150px;
}

.content-table th:nth-child(3) {
  width: 160px;
}

.content-table th:nth-child(4) {
  width: 170px;
}

.content-table th:nth-child(5) {
  width: 70px;
}

.content-table th:nth-child(6) {
  width: 225px;
}

.content-table th {
  padding: 12px 14px;
  color: var(--muted);
  background: #fbfaf8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

.content-table td {
  border-top: 1px solid var(--line);
  padding: 13px 14px;
  vertical-align: middle;
}

.content-table tbody tr:hover {
  background: #fdfbf9;
}

.date-cell {
  width: 145px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.table-date-input {
  width: 132px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 7px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.table-date-input:hover,
.table-date-input:focus {
  border-color: var(--line-strong);
  outline: none;
  background: #fff;
}

.table-title,
.table-title-static {
  display: block;
  max-width: 360px;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-title:hover {
  color: var(--wine);
}

.table-excerpt {
  display: block;
  max-width: 390px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.format-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.format-badge {
  color: #5a5254;
  background: #f1eeec;
}

.format-carousel {
  color: #5f3f8e;
  background: #f1eafa;
}

.format-reel,
.format-story {
  color: #225f7b;
  background: #e8f4fa;
}

.format-select {
  width: auto;
  min-width: 125px;
  border: 0;
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  color: #5a5254;
  background-color: #f1eeec;
  font-size: 11px;
  font-weight: 800;
}

.format-select-carousel {
  color: #5f3f8e;
  background-color: #f1eafa;
}

.format-select-reel,
.format-select-story {
  color: #225f7b;
  background-color: #e8f4fa;
}

.status-do_akceptacji {
  color: var(--status-gray);
  background: var(--status-gray-soft);
}

.status-zaakceptowany {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.status-select {
  width: auto;
  min-width: 142px;
  border: 0;
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.status-select-do_akceptacji {
  color: var(--status-gray);
  background-color: var(--status-gray-soft);
}

.status-select-zaakceptowany {
  color: var(--blue);
  background-color: var(--blue-soft);
}

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

.media-count {
  width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.actions-column {
  white-space: nowrap;
}

.table-actions {
  white-space: nowrap;
}

.table-actions .small-action + .small-action {
  margin-left: 2px;
}

.inline-empty {
  padding: 38px;
  color: var(--muted);
  text-align: center;
}

.clickable-row {
  cursor: pointer;
}

/* Calendar */

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 8px 0 15px;
}

.calendar-toolbar h2 {
  min-width: 220px;
  margin: 0;
  font-size: 20px;
  text-align: center;
}

.calendar-toolbar h2::first-letter {
  text-transform: uppercase;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-weekdays span {
  padding: 8px;
}

.calendar-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.calendar-day {
  position: relative;
  min-height: 126px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-day.outside-month {
  background: #fbfaf9;
}

.calendar-day.outside-month .calendar-day-number,
.calendar-day.outside-month .calendar-post {
  opacity: 0.42;
}

.calendar-day-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  margin: 0 0 5px auto;
  border-radius: 50%;
  color: #5d5658;
  font-size: 11px;
  font-weight: 750;
}

.calendar-day.today .calendar-day-number {
  color: #fff;
  background: var(--wine);
}

.calendar-post {
  display: block;
  width: 100%;
  overflow: hidden;
  margin-top: 4px;
  border: 0;
  border-left: 3px solid var(--status-gray);
  border-radius: 7px;
  padding: 5px 6px;
  cursor: pointer;
  background: #f5f5f5;
  text-align: left;
}

.calendar-post.status-border-zaakceptowany {
  border-left-color: var(--blue);
  background: #f2f8ff;
}

.calendar-post.status-border-opublikowane {
  border-left-color: var(--green);
  background: #f1f8f4;
}

.calendar-post-format {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calendar-post strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

/* Dialogs and forms */

.dialog {
  width: min(94vw, 650px);
  max-height: 92vh;
  overflow: visible;
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(24, 17, 19, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-small {
  width: min(92vw, 430px);
}

.dialog-wide {
  width: min(94vw, 760px);
}

.dialog-card {
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 25px;
  background: #fff;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 24px;
}

.dialog-close {
  flex: 0 0 auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.dialog-actions-between {
  justify-content: space-between;
}

.dialog-actions-right {
  display: flex;
  gap: 9px;
  margin-left: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.existing-media {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.existing-media h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.media-file-list {
  display: grid;
  gap: 7px;
}

.media-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fbfaf8;
}

.media-file-info {
  min-width: 0;
}

.media-file-info strong,
.media-file-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-info strong {
  font-size: 12px;
}

.media-file-info small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(390px, calc(100vw - 44px));
  transform: translateY(20px);
  border-radius: 12px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  color: #fff;
  background: #292225;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 700;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-error {
  background: var(--danger);
}

/* Post preview */

.preview-dialog {
  width: min(96vw, 1040px);
}

.preview-dialog-card {
  position: relative;
  padding: 30px;
  background: #f7f7f7;
}

.preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
}

.preview-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(320px, 500px) minmax(250px, 1fr);
  gap: 28px;
  padding: 15px;
}

.instagram-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.instagram-header {
  display: flex;
  height: 60px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
}

.instagram-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  color: var(--ink);
  background:
    linear-gradient(#fff, #fff) padding-box,
    radial-gradient(circle at 30% 110%, #ffd600 0 18%, #ff7a00 30%, #ff0169 56%, #d300c5 76%, #7638fa 100%) border-box;
  font-size: 12px;
  font-weight: 850;
}

.instagram-account {
  min-width: 0;
}

.instagram-account strong,
.instagram-account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instagram-account strong {
  font-size: 12px;
}

.instagram-account span {
  color: var(--muted);
  font-size: 9px;
}

.instagram-dots {
  margin-left: auto;
  letter-spacing: 2px;
}

.instagram-media {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  place-items: center;
  background: #efefef;
}

.instagram-media.media-post .media-slide,
.instagram-media.media-carousel .media-slide {
  object-fit: cover;
}

.instagram-media.media-story,
.instagram-media.media-reel {
  aspect-ratio: 9 / 14;
  max-height: 670px;
  background: #171315;
}

.media-slide {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #161214;
}

.media-slide.active {
  display: block;
}

.media-placeholder {
  display: grid;
  place-items: center;
  color: #887f82;
}

.media-placeholder-icon {
  font-size: 42px;
}

.media-placeholder strong {
  margin-top: 7px;
  font-size: 12px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #282124;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.carousel-arrow svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.56);
  font-size: 9px;
  font-weight: 750;
}

.carousel-dots {
  position: absolute;
  bottom: 9px;
  left: 50%;
  z-index: 2;
  display: flex;
  transform: translateX(-50%);
  gap: 4px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
}

.carousel-dot.active {
  background: #369bd7;
}

.instagram-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 13px 5px;
  line-height: 1;
}

.instagram-action-icon {
  display: inline-flex;
  width: 23px;
  height: 23px;
  align-items: center;
  justify-content: center;
  color: #111;
}

.instagram-action-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.instagram-save {
  margin-left: auto;
}

.instagram-preview-label {
  padding: 4px 13px 2px;
  color: #262626;
  font-size: 11px;
  font-weight: 750;
}

.instagram-caption {
  padding: 3px 13px 15px;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.instagram-caption p {
  max-height: 125px;
  overflow-y: auto;
  margin-bottom: 7px;
  white-space: pre-wrap;
}

.instagram-caption time {
  color: #8d8587;
  font-size: 8px;
  text-transform: uppercase;
}

.preview-details {
  padding: 24px 6px;
}

.preview-details h2 {
  margin: 14px 0 20px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.preview-details h3 {
  margin: 24px 0 8px;
  font-size: 13px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 14px 0;
}

.preview-meta div {
  display: grid;
  gap: 2px;
  padding-right: 9px;
}

.preview-meta span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-meta strong {
  font-size: 12px;
}

.preview-copy {
  max-height: 280px;
  overflow-y: auto;
  color: #554e50;
  font-size: 13px;
  white-space: pre-wrap;
}

/* Public */

.public-page {
  background:
    linear-gradient(180deg, rgba(122, 35, 59, 0.06), transparent 320px),
    var(--cream);
}

.public-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 60px;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(214, 207, 204, 0.78);
  border-radius: 18px;
  padding: 17px 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.public-branding {
  display: flex;
  align-items: center;
  gap: 13px;
}

.public-header h1 {
  margin: 0;
  font-size: clamp(21px, 3vw, 30px);
}

.public-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.readonly-badge {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--wine);
  background: var(--wine-soft);
}

.public-planner {
  margin-top: 24px;
}

.public-message {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 45px;
  background: #fff;
  text-align: center;
}

/* Responsive */

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .main-panel {
    padding-inline: 22px;
  }

  .preview-layout {
    grid-template-columns: minmax(280px, 440px) minmax(220px, 1fr);
    gap: 18px;
    padding: 5px;
  }

  .calendar-day {
    min-height: 105px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

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

  .sidebar-brand {
    padding-bottom: 10px;
  }

  .sidebar-heading {
    display: none;
  }

  .brand-list {
    display: flex;
    margin: 4px -2px 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .brand-row {
    min-width: 220px;
  }

  .logout-form {
    display: none;
  }

  .main-panel {
    padding: 22px 14px 50px;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .button {
    flex: 1;
  }

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

  .content-table {
    min-width: 900px;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 720px;
  }

  #calendar-view,
  #public-calendar-view {
    overflow-x: auto;
    padding-bottom: 7px;
  }

  .preview-dialog-card {
    padding: 22px 12px;
  }

  .preview-layout {
    display: block;
  }

  .instagram-card {
    width: min(100%, 500px);
    margin: 0 auto;
  }

  .preview-details {
    width: min(100%, 500px);
    margin: 0 auto;
    padding: 22px 4px 4px;
  }

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

  .public-meta {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 27px 22px;
  }

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

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .summary {
    padding-left: 2px;
  }

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

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

  .dialog-card {
    padding: 20px;
  }

  .dialog-actions-between {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions-right {
    width: 100%;
    margin-left: 0;
  }

  .dialog-actions-right .button {
    flex: 1;
  }

  .public-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 10px;
  }

  .public-header {
    border-radius: 14px;
    padding: 14px;
  }

  .public-meta > span:last-child {
    display: none;
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .view-toolbar,
  .public-meta,
  .table-actions,
  .actions-column {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-panel,
  .public-shell {
    width: 100%;
    padding: 0;
  }

  .table-wrap,
  .calendar-grid,
  .public-header {
    box-shadow: none;
  }
}
