/* Platforma — landing, auth, dashboard */
.platform {
  min-height: 100vh;
  background: linear-gradient(165deg, #fff8f4 0%, #fff1ea 45%, #fdeee8 100%);
  color: #2a2218;
  font-family: "DM Sans", system-ui, sans-serif;
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(42, 34, 24, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.platform-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.platform-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.platform-nav a {
  color: #5c4f42;
  text-decoration: none;
  font-weight: 500;
}

.platform-nav__logout button {
  background: none;
  border: none;
  color: #8a4a3d;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.platform-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.platform--wide .platform-main {
  max-width: min(96vw, 1600px);
  margin: 0 auto;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.platform--wide .platform-header {
  max-width: min(96vw, 1600px);
  margin: 0 auto;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.platform-hero {
  text-align: center;
  padding: 2.5rem 0 3rem;
}

.platform-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: #9a6b5c;
  margin-bottom: 0.75rem;
}

.platform-hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.platform-lead {
  max-width: 38rem;
  margin: 0 auto 1.75rem;
  color: #5c4f42;
  font-size: 1.05rem;
  line-height: 1.6;
}

.platform-hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(42, 34, 24, 0.14);
  background: #fff;
  color: #2a2218;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.platform-btn--primary {
  background: #8a4a3d;
  border-color: #8a4a3d;
  color: #fff;
}

.platform-btn--ghost {
  background: transparent;
}

.platform-btn--lg {
  padding: 0.75rem 1.35rem;
}

.platform-btn--sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.platform-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.platform-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(42, 34, 24, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
}

.platform-card h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.platform-card p {
  margin: 0;
  color: #5c4f42;
  line-height: 1.5;
}

.platform-auth {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.platform-auth__card {
  width: min(100%, 480px);
}

.platform-auth__hint {
  margin: 0 0 0.75rem;
  color: #5c4f42;
  font-size: 0.9rem;
}

.platform-divider {
  border: none;
  border-top: 1px solid rgba(42, 34, 24, 0.1);
  margin: 1rem 0;
}

.platform-slug-field {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(42, 34, 24, 0.14);
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
}

.platform-slug-field__prefix {
  padding: 0.55rem 0.65rem;
  background: #f8f0eb;
  color: #7a6a5c;
  font-size: 0.82rem;
  white-space: nowrap;
}

.platform-slug-field input {
  border: none;
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.platform-slug-hint {
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.platform-slug-hint--err {
  color: #9a3b32;
}

.platform-slug-hint--ok {
  color: #3d6b4f;
}

.platform-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.platform-grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

.platform-settings-domain-row {
  align-items: start;
}

.platform-settings-domain-row .field-hint {
  margin-top: 0.35rem;
}

.platform-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.platform-panel h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0 0 1.25rem;
}

.platform-section {
  margin-top: 2rem;
}

.platform-section:first-of-type {
  margin-top: 1.5rem;
}

.platform-site-list {
  display: grid;
  gap: 1rem;
}

.platform-site-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 34, 24, 0.08);
  border-radius: 1rem;
}

.platform-site-card h2 {
  margin: 0 0 0.35rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.platform-site-card__url a {
  color: #8a4a3d;
  word-break: break-all;
}

.platform-site-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.platform-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1rem;
}

.platform-settings-section {
  margin-top: 1.5rem;
}

.platform-settings-card {
  padding: 1.25rem;
}

.platform-settings-card .login-label {
  margin-bottom: 0.85rem;
}

.platform-settings-card .login-label input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(42, 34, 24, 0.14);
  border-radius: 0.65rem;
  font: inherit;
}

.platform-settings-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.platform-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(42, 34, 24, 0.08);
}

.platform-settings-toggle-row strong {
  display: block;
  margin-bottom: 0.15rem;
}

.platform-settings-toggle {
  flex-shrink: 0;
}

.platform-music-card {
  margin-bottom: 0;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 34, 24, 0.08);
  border-radius: 1rem;
}

.platform-music-form .music-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.platform-music-form .platform-music-save {
  flex-shrink: 0;
  white-space: nowrap;
}

.platform-music-form .music-inline__src {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(42, 34, 24, 0.14);
  border-radius: 0.65rem;
}

.platform-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0;
}

.platform-stat {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(42, 34, 24, 0.08);
}

.platform-stat strong {
  display: block;
  font-size: 1.75rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.platform-panel__head .platform-section-title {
  margin: 0;
}

.platform-section-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.platform-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(42, 34, 24, 0.08);
  padding: 0.35rem 0;
}

.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.platform-table--sites {
  table-layout: auto;
}

.platform-table th,
.platform-table td {
  padding: 0.85rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid rgba(42, 34, 24, 0.06);
  vertical-align: middle;
}

.platform-table thead th {
  padding-top: 1rem;
  padding-bottom: 0.75rem;
  font-weight: 600;
  color: #5c4f42;
  border-bottom: 1px solid rgba(42, 34, 24, 0.1);
}

.platform-table tbody tr:last-child td {
  border-bottom: none;
  padding-bottom: 1rem;
}

.platform-table-row--link {
  cursor: pointer;
}

.platform-table-row--link:hover td,
.platform-table-row--link:focus-visible td {
  background: rgba(201, 162, 39, 0.07);
}

.platform-table-row--link:focus {
  outline: none;
}

.platform-table--sites th:nth-child(3),
.platform-table--sites td:nth-child(3) {
  word-break: break-word;
}

.platform-table__owner-name {
  display: block;
  font-weight: 500;
}

.platform-table__owner-email {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: #7a6a5c;
}

.platform-table .cell-actions {
  text-align: center;
  white-space: nowrap;
}

.platform-table--users th:nth-child(1),
.platform-table--users td:nth-child(1) {
  width: 24%;
}

.platform-table--users th:nth-child(2),
.platform-table--users td:nth-child(2) {
  width: 30%;
  word-break: break-word;
}

.platform-table--users th:nth-child(3),
.platform-table--users td:nth-child(3) {
  width: 5rem;
  text-align: center;
}

.platform-table--users .admin-guest-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.platform-table--users th:last-child,
.platform-table--users td:last-child {
  width: auto;
  min-width: calc(2.5rem + 3 * 2.15rem + 3 * 0.35rem + 0.5rem);
}

.platform-table--sites th:last-child,
.platform-table--sites td:last-child {
  width: auto;
  min-width: calc(2.5rem + 6 * 2.15rem + 6 * 0.35rem + 0.5rem);
}

.platform-table--user-sites th:last-child,
.platform-table--user-sites td:last-child {
  min-width: calc(2.5rem + 3 * 2.15rem + 3 * 0.35rem + 0.5rem);
}

.platform-table--user-sites th:nth-child(1),
.platform-table--user-sites td:nth-child(1) {
  width: 22%;
}

.platform-table--user-sites th:nth-child(2),
.platform-table--user-sites td:nth-child(2) {
  width: auto;
  word-break: break-word;
}

.platform-row--inactive td {
  opacity: 0.72;
}

.platform-table--sites .admin-guest-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.platform-table .admin-guest-action-btn {
  text-decoration: none;
}

.platform-table__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.platform-table__actions form {
  margin: 0;
}

.platform-table__muted {
  color: #9a8f84;
}

.platform-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(42, 34, 24, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #5c4f42;
  cursor: pointer;
  font: inherit;
  flex-shrink: 0;
}

.platform-icon-btn:hover {
  background: #f8f0eb;
  color: #2a2218;
  border-color: rgba(42, 34, 24, 0.2);
}

.platform-icon-btn--danger {
  color: #a63d32;
}

.platform-icon-btn--danger:hover {
  background: #fdf0ee;
  border-color: rgba(166, 61, 50, 0.25);
  color: #8a2e25;
}

.platform-icon-btn--ok {
  color: #2d6a45;
}

.platform-icon-btn--ok:hover {
  background: #edf7f0;
  border-color: rgba(45, 106, 69, 0.25);
}

.platform-icon-btn__svg {
  display: block;
}

.platform-modal__panel {
  max-width: 28rem;
}

.platform-modal__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2a2218;
}

.platform-modal__form {
  margin-top: 0.5rem;
}

.platform-modal__form .login-label {
  margin-bottom: 0.85rem;
}

.platform-modal__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.platform-modal .login-card__err {
  margin: 0 0 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #f0e4dc;
  color: #6b4f44;
}

.badge--ok {
  background: #e4f2e8;
  color: #2d6a45;
}

.badge--muted {
  background: #eee;
  color: #666;
}

@media (max-width: 640px) {
  .platform-grid-2,
  .platform-grid-3,
  .platform-stats {
    grid-template-columns: 1fr;
  }
  .platform-slug-field {
    flex-direction: column;
    align-items: stretch;
  }
  .platform-slug-field__prefix {
    border-bottom: 1px solid rgba(42, 34, 24, 0.08);
  }
}
