@layer components {
  .password-control {
    position: relative;
    display: block;
  }
  .form-grid .password-control input {
    width: 100%;
    padding-right: 54px;
  }
  .password-control input::-ms-reveal {
    display: none;
  }
  .password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 44px;
    min-height: 44px;
    color: var(--muted);
  }
  .auth-page {
    max-width: 580px;
    margin: 50px auto;
    text-align: center;
    padding: 45px 32px;
    background: linear-gradient(145deg, #fff, #f7f1e4);
    border: 1px solid #e9ddc4;
    border-radius: 22px;
  }
  .auth-page > .brand-symbol {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
  }
  .auth-page > p {
    color: var(--muted);
    margin: 18px 0 26px;
  }
  .auth-page > .button {
    margin: 5px;
  }
  .auth-intro {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 25px;
  }
  .auth-intro p {
    font-size: 12px;
    color: var(--muted);
  }
  .auth-mark {
    display: grid;
    place-items: center;
    background: #f6efdf;
    border-radius: 14px;
    width: 52px;
    height: 52px;
    color: var(--gold);
    flex-shrink: 0;
  }
  .auth-switch {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 16px;
    font-size: 12px;
  }
  .recovery-code,
  .setup-command {
    display: block;
    font-size: 13px;
    overflow-wrap: anywhere;
    padding: 22px;
    background: #f3efdf;
    border: 1px dashed #c8b580;
    border-radius: 12px;
    margin: 20px 0;
    user-select: all;
  }
  .recovery-code ~ .button {
    margin: 5px;
  }
  .profile-username {
    color: var(--gold) !important;
  }
  .account-actions {
    margin: 20px 0;
  }
  .account-actions > .button {
    font-size: 10px;
    padding: 9px 13px;
    gap: 8px;
  }
  .account-actions .icon {
    width: 14px;
  }
  .cms-shortcuts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 22px 0;
  }
  .cms-shortcuts .button {
    font-size: 11px;
    gap: 12px;
  }
  .cms-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
  }
  .cms-toolbar > label {
    display: grid;
    gap: 7px;
    font-size: 11px;
    color: var(--muted);
    flex: 1;
  }
  .cms-toolbar select {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 12px;
    background: white;
    color: var(--ink);
  }
  .cms-records {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  .cms-record,
  .user-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    background: white;
  }
  .cms-record:last-child,
  .user-row:last-child {
    border-bottom: 0;
  }
  .cms-record:hover {
    background: #faf7ef;
  }
  .cms-record > span:first-child,
  .user-row > span:first-child {
    flex: 1;
  }
  .cms-record strong,
  .user-row b {
    display: block;
    font-size: 13px;
    font-weight: 600;
  }
  .cms-record small,
  .user-row small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px;
  }
  .cms-record > .icon {
    width: 17px;
  }
  .cms-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    gap: 15px;
  }
  .cms-pagination > span {
    font-size: 11px;
    color: var(--muted);
  }
  .cms-pagination > .button {
    font-size: 10px;
    padding: 8px 14px;
    min-height: 36px;
  }
  .required {
    color: var(--gold);
  }
  .form-grid select[multiple] {
    min-height: 115px;
  }
  .form-grid select[multiple] option {
    padding: 5px;
    border-radius: 5px;
  }
  .upload-control {
    display: grid;
    gap: 7px;
  }
  .upload-control small {
    font-size: 10px;
    color: var(--muted);
  }
  .cms-image-preview {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    align-self: start;
    margin-top: 9px;
    border-radius: 10px;
  }
  .contact-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 20px;
  }
  .contact-links .pill {
    align-self: flex-start;
  }
  .listing-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
    background: #f7f7f7;
    margin: 20px 0;
  }
  .inquiry {
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
  }
  .inquiry > small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin: 5px 0 10px;
  }
  .inquiry > p {
    font-size: 12px;
    white-space: pre-wrap;
  }
  .inquiry > blockquote {
    background: #f7f2e6;
    border-left: 2px solid var(--gold);
    padding: 15px;
    margin: 15px 0 0;
    font-size: 12px;
    white-space: pre-wrap;
  }
  .inquiry > .button {
    margin-top: 15px;
  }
  .care-proposal {
    background: #faf6ed;
    border: 1px solid #e6d7b5;
    border-radius: 12px;
    padding: 22px;
    margin: 20px 0;
  }
  .care-proposal > p {
    white-space: pre-wrap;
    margin: 12px 0;
    font-size: 12px;
  }
  .care-proposal > strong {
    display: block;
    font-size: 26px;
    letter-spacing: -0.03em;
  }
  .chat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .chat-heading > p {
    font-size: 11px;
    color: var(--muted);
  }
  .live-status {
    color: #58856d;
    font-size: 9px;
    white-space: nowrap;
  }
  .live-status:before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
  }
  .live-status[data-status="liveReconnecting"] {
    color: #b48c42;
  }
  .message-image {
    max-width: 260px;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: #f1eee8;
    border-radius: 11px;
    margin-top: 7px;
  }
  .message-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5d6b4;
    background: #f8f3e7;
    border-radius: 10px;
    padding: 13px;
    font-size: 12px;
    margin-top: 7px;
  }
  .message-card > .icon {
    width: 16px;
    color: var(--gold);
  }
  .message-card > .icon:last-child {
    margin-left: auto;
  }
  .message-translation:not(:empty) {
    border-left: 2px solid #d9c495;
    margin: 9px 0;
    padding: 5px 10px;
    font-size: 11px;
    color: #8f8266;
  }
  .chat-tools {
    display: flex;
    gap: 2px;
    align-items: center;
  }
  .file-input-hidden {
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    position: absolute;
    overflow: hidden;
  }
  .chat-tools > label {
    cursor: pointer;
  }
  .chat-tools .icon-button {
    position: relative;
    width: 31px;
    height: 37px;
  }
  .chat-compose > input {
    min-width: 80px;
  }
  .chat-attachments:empty,
  .attachment-status:empty {
    display: none;
  }
  .chat-attachments {
    display: flex;
    gap: 7px;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 5px;
  }
  .chat-attachments select {
    font-size: 11px;
    max-width: 50%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px;
  }
  .chat-attachments > .button {
    font-size: 10px;
    padding: 7px 13px;
    min-height: 32px;
  }
  .attachment-status {
    width: 100%;
    font-size: 10px;
    color: var(--gold);
  }
  .redactor {
    margin-top: 10px;
    padding: 15px;
    border: 1px solid #dfd1b5;
    background: #fcfaf5;
    border-radius: 12px;
  }
  .redactor > p {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .redactor canvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: crosshair;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 5px;
  }
  .redactor .actions {
    margin: 13px 0;
  }
  .redactor .button {
    font-size: 11px;
    padding: 8px 12px;
    min-height: 34px;
    gap: 8px;
  }
  .redactor img {
    max-height: 300px;
    object-fit: contain;
  }
  .moderation-item {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 16px 0;
    background: white;
  }
  .moderation-item > p {
    font-size: 12px;
    margin: 12px 0;
  }
  .moderation-item > h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .moderation-item > .pill {
    margin-bottom: 14px;
  }
  .moderation-item img {
    max-height: 300px;
    object-fit: contain;
    margin: 13px auto;
    border-radius: 8px;
  }
  .moderation-item .form-grid {
    margin-top: 16px;
  }
  .ticket-type {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }
  .ticket-type > strong {
    flex: 1;
  }
  .floor-map.actual-map:before,
  .floor-map.actual-map > .booth,
  .floor-map.actual-map > .dance-floor,
  .floor-map.actual-map > .floor-watermark,
  .floor-map.actual-map > .entrance {
    display: none;
  }
  .floor-background {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
  }
  .floor-map.actual-map > .floor-table {
    opacity: 0.92;
    width: auto;
    min-width: 70px;
    max-width: 130px;
    height: auto;
    min-height: 46px;
    padding: 8px;
  }
  .floor-map.actual-map {
    height: auto;
    min-height: 0;
    background: #fff;
  }
  .user-row .text-button {
    font-size: 11px;
    white-space: nowrap;
  }
}
@layer responsive {
  @media (max-width: 640px) {
    .auth-page {
      padding: 30px 24px;
      margin: 25px auto;
    }
    .auth-page h2 {
      font-size: 25px;
    }
    .auth-page > p {
      font-size: 12px;
    }
    .auth-form {
      grid-template-columns: 1fr;
    }
    .cms-shortcuts {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .cms-shortcuts > .button {
      font-size: 12px;
      padding: 12px;
      gap: 7px;
      min-height: 52px;
      word-break: keep-all;
      justify-content: space-between;
    }
    .cms-toolbar {
      gap: 10px;
    }
    .cms-toolbar > .button {
      padding: 10px 13px;
      gap: 8px;
      font-size: 10px;
    }
    .cms-record,
    .user-row {
      padding: 15px 13px;
      gap: 10px;
    }
    .cms-record strong,
    .user-row b {
      font-size: 12px;
    }
    .cms-record small,
    .user-row small {
      font-size: 9px;
    }
    .cms-record > .pill {
      font-size: 10px;
    }
    .cms-pagination {
      gap: 8px;
    }
    .cms-pagination > span {
      font-size: 9px;
    }
    .message-image {
      max-width: 225px;
    }
    .chat-heading {
      align-items: flex-start;
    }
    .chat-heading > p {
      max-width: 73%;
    }
    .live-status {
      font-size: 8px;
    }
    .chat-compose {
      gap: 5px;
    }
    .chat-compose > input {
      padding: 10px 8px;
      font-size: 16px;
    }
    .chat-tools .icon-button {
      width: 36px;
      min-height: 44px;
    }
    .chat-tools .icon {
      width: 17px;
      height: 17px;
    }
    .moderation-item {
      padding: 15px;
    }
    .user-row .text-button {
      font-size: 12px;
      min-height: 44px;
    }
    .date-tile small {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .cms-image-preview {
      max-height: 150px;
    }
    .setup-command {
      font-size: 11px;
    }
  }
}

@layer components {
  .floor-map.zone-list {
    height: auto;
    min-height: 0;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: start;
    background: var(--paper);
  }
  .zone-list:before,
  .zone-list > .booth,
  .zone-list > .dance-floor,
  .zone-list > .entrance,
  .zone-list > .floor-watermark {
    display: none;
  }
  .zone-list > .floor-table {
    position: static;
    transform: none;
    min-width: 90px;
  }
  img {
    color: transparent;
  }
}
@layer responsive {
  @media (max-width: 640px) {
    .form-grid input,
    .form-grid select,
    .form-grid textarea,
    .search-bar input {
      font-size: 16px;
      min-height: 44px;
    }
    .form-grid label {
      font-size: 12px;
    }
    .message-body {
      font-size: 13px;
    }
    .message-actions button {
      min-height: 34px;
      padding: 5px 0;
    }
    .cms-record small,
    .user-row small,
    .cms-pagination > span {
      font-size: 11px;
    }
    .cms-record strong,
    .user-row b {
      font-size: 14px;
    }
    .cms-toolbar > .button {
      font-size: 12px;
      min-height: 44px;
    }
  }
}
@layer onboarding {
  .admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: linear-gradient(115deg, #fbf6ec, #fff);
    border: 1px solid #e9ddc6;
    border-radius: 20px;
    margin-bottom: 18px;
  }
  .admin-eyebrow {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: #967036;
  }
  .admin-hero h1 {
    font-size: 30px;
    margin: 10px 0;
  }
  .admin-hero p {
    color: #756d62;
    font-size: 14px;
  }
  .admin-hero > .icon {
    width: 48px;
    height: 48px;
    color: #a7803a;
    flex-shrink: 0;
    margin-left: 14px;
  }
  .admin-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }
  .admin-metrics > div {
    padding: 18px;
    border: 1px solid #ece5da;
    border-radius: 14px;
    background: white;
  }
  .admin-metrics span {
    font-size: 12px;
    color: #746c60;
    display: block;
  }
  .admin-metrics strong {
    display: block;
    font-size: 29px;
    margin-top: 8px;
    font-weight: 500;
  }
  .admin-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 0 38px;
  }
  .admin-tool-grid button {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px 16px;
    border: 1px solid #e7e2d9;
    border-radius: 14px;
    text-align: left;
    background: white;
    transition: background 0.15s;
  }
  .admin-tool-grid button:hover {
    background: #fcf7ed;
  }
  .admin-tool-grid button > .icon {
    width: 18px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .admin-tool-grid strong {
    display: block;
    font-size: 15px;
  }
  .admin-tool-grid small {
    display: block;
    font-size: 11px;
    line-height: 1.6;
    color: #797063;
    margin-top: 5px;
  }
  .admin-tool-icon {
    color: #a17b35;
    display: grid;
    place-items: center;
    width: 38px;
    height: 42px;
    flex-shrink: 0;
  }
  .admin-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 18px;
  }
  .admin-filters button {
    flex-shrink: 0;
  }
  .admin-filters button[aria-pressed="true"] {
    background: #25211b;
    color: white;
  }
  .collector-form {
    padding: 20px;
    background: #faf7f1;
    border: 1px solid #e9dfcd;
    border-radius: 14px;
    margin: 18px 0 28px;
  }
  .collection-heading {
    font-size: 17px;
    margin-bottom: 16px;
  }
  .collection-record {
    padding: 18px 0;
    border-top: 1px solid #e8e4dc;
  }
  .collection-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .collection-title strong {
    overflow-wrap: anywhere;
  }
  .source-link {
    display: flex;
    gap: 8px;
    color: #8b672b;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.6;
    margin: 10px 0;
  }
  .source-link .icon {
    flex-shrink: 0;
    width: 16px;
  }
  .collection-record > small {
    font-size: 11px;
    color: #817a70;
  }
  .collection-record .actions {
    margin-top: 15px;
    flex-wrap: wrap;
  }
  .collection-error {
    color: #a33523;
    font-size: 13px;
    margin-top: 10px;
  }
  @media (max-width: 640px) {
    .admin-hero {
      padding: 22px 18px;
    }
    .admin-hero h1 {
      font-size: 26px;
    }
    .admin-metrics {
      grid-template-columns: repeat(3, 1fr);
    }
    .admin-metrics > div {
      padding: 12px;
    }
    .admin-metrics span {
      font-size: 10px;
    }
    .admin-tool-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .admin-tool-grid button {
      padding: 15px 10px;
      gap: 5px;
      align-items: flex-start;
    }
    .admin-tool-icon {
      width: 25px;
      height: 25px;
    }
    .admin-tool-grid button > .icon {
      display: none;
    }
    .admin-tool-grid strong {
      font-size: 13px;
    }
    .collector-form {
      padding: 14px;
    }
  }
}

@layer onboarding {
  .collection-evidence {
    margin-top: 14px;
    border-top: 1px solid #e8e1d7;
    padding-top: 12px;
  }
  .collection-evidence summary {
    cursor: pointer;
    color: #806025;
    font-weight: 650;
    font-size: 13px;
    padding: 5px 0;
  }
  .collection-evidence article {
    padding: 14px 0;
    border-bottom: 1px solid #eee8de;
  }
  .collection-evidence p {
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }
  .collection-evidence small,
  .evidence-kind {
    font-size: 11px;
    color: #797269;
  }
}
