@media (min-width: 1200px) {
  .container {
    width: min(1220px, calc(100vw - 32px));
    padding-top: max(22px, var(--tc-safe-top));
    padding-bottom: max(124px, calc(var(--tc-safe-bottom) + 90px));
  }

  .hero {
    max-width: 920px;
    margin: 12px auto 28px;
  }

  .hero h1 {
    font-size: clamp(36px, 3.2vw, 66px);
  }

  .hero p {
    font-size: clamp(15px, 1.05vw, 18px);
  }

  .home-view {
    gap: 16px;
  }

  .home-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-actions .action-card:last-child {
    grid-column: auto;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .action-card {
    min-height: 224px;
    padding: 22px 20px 20px;
  }

  .action-card h3 {
    font-size: clamp(24px, 1.55vw, 34px);
  }

  .action-card p {
    font-size: 15px;
    line-height: 1.75;
  }

  .guard-card.guard-open {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .panel,
  .card {
    padding: 20px;
  }

  .about-modal {
    width: min(680px, 90vw);
    padding: 22px;
  }

  .confirm-sheet {
    width: min(620px, 90vw);
    padding: 22px;
  }
}
@media (max-width: 1120px) {
  .site-topbar {
    border-radius: 24px;
  }

  .home-actions {
    grid-template-columns: 1fr 1fr;
  }

  .guard-grid,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .site-brand {
    flex: 1 1 100%;
  }

  .site-nav-desktop {
    display: none;
  }

  .site-bottom-nav {
    display: flex;
  }

  .site-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .home-actions {
    grid-template-columns: 1fr;
  }

  .home-actions .action-card:last-child {
    grid-column: auto;
    width: 100%;
  }

  .action-card {
    min-height: 154px;
    border-radius: 24px;
  }

  .guard-grid,
  .theme-grid,
  .public-list,
  .public-grid,
  .attachment-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .segment {
    min-height: 68px;
  }

  .public-toolbar {
    align-items: stretch;
  }

  .public-toolbar select {
    min-width: 0;
    flex: 1 1 100%;
  }

  .public-toolbar .btn,
  .public-toolbar .btn-light {
    flex: 1 1 calc(50% - 10px);
  }

  .admin-app {
    display: block;
    width: min(100vw, calc(100vw - 24px));
  }

  .admin-sidebar {
    position: fixed;
    top: calc(var(--tc-safe-top) + 12px);
    left: 12px;
    width: min(320px, calc(100vw - 24px));
    height: calc(100dvh - var(--tc-safe-top) - var(--tc-safe-bottom) - 24px);
    max-height: calc(100dvh - var(--tc-safe-top) - var(--tc-safe-bottom) - 24px);
    transform: translateX(-110%);
    transition: transform var(--tc-duration-normal) var(--tc-spring);
    z-index: 70;
  }

  .admin-sidebar.is-open,
  body.is-drawer-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-drawer-backdrop {
    display: none;
  }

  body.is-drawer-open .admin-drawer-backdrop,
  html.is-drawer-open .admin-drawer-backdrop {
    display: grid;
  }

  .admin-menu-button {
    display: inline-flex;
  }

  .admin-content,
  .admin-guest-main {
    padding-top: 6px;
  }

  .table-wrap {
    border-radius: 20px;
  }
}

@media (min-width: 861px) {
  .admin-menu-button {
    display: none;
  }
}

@media (max-width: 780px) {
  .blob {
    filter: blur(48px);
    opacity: .14;
  }

  .card,
  .about-modal-mask {
    backdrop-filter: none;
  }

  .card,
  .panel,
  .result,
  .public-item,
  .open-ceremony,
  .about-modal,
  .confirm-sheet,
  .template-library,
  .time-preview,
  .guard-card.guard-open,
  .preview-item {
    border-radius: 20px;
  }

  .panel,
  .card,
  .result,
  .public-item,
  .template-library,
  .open-ceremony {
    padding: 12px;
  }

  .site-topbar {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 20px;
  }

  .site-brand-mark,
  .admin-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 13px;
  }

  .site-brand-copy strong,
  .admin-brand-copy strong {
    font-size: 13px;
  }

  .site-brand-copy span,
  .admin-brand-copy span {
    font-size: 10px;
  }

  .site-bottom-nav {
    left: 10px;
    right: 10px;
    border-radius: 20px;
  }

  .site-bottom-nav .nav-chip {
    min-height: 42px;
    font-size: 10px;
  }

  .container {
    max-width: 460px;
    padding: max(10px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
  }

  .top-link-wrap {
    margin-bottom: 6px;
  }

  .about-open {
    height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .hero-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .hero-logo svg {
    width: 22px;
    height: 22px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero p {
    font-size: 12px;
  }

  .home-actions {
    grid-template-columns: 1fr;
  }

  .home-actions .action-card:last-child {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }

  .action-card {
    min-height: 126px;
    border-radius: 18px;
    padding: 12px 11px;
  }

  .action-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .action-icon svg {
    width: 16px;
    height: 16px;
  }

  .action-card h3 {
    font-size: 18px;
  }

  .action-card p {
    font-size: 12px;
    line-height: 1.6;
  }

  .guard-anchor {
    font-size: 12px;
  }

  .guard-anchor-icons {
    font-size: 12px;
    gap: 8px;
  }

  .guard-card {
    padding: 12px 10px;
  }

  .guard-intro {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .guard-title {
    font-size: 17px;
  }

  .guard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .guard-item h4 {
    font-size: 14px;
  }

  .guard-item p {
    font-size: 11px;
    line-height: 1.6;
  }

  .panel {
    padding: 10px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-head .btn-light {
    width: 100%;
  }

  .editor-head .ghost-btn {
    width: 100%;
  }

  .time-preview-content strong {
    font-size: 15px;
  }

  .time-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .template-library {
    padding: 8px;
  }

  .template-tip {
    font-size: 10px;
    text-align: left;
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .theme-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .template-btn {
    height: 30px;
    font-size: 11px;
  }

  .time-btn {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    font-size: 11px;
  }

  .time-btn-custom {
    min-width: 0;
    grid-column: span 2;
  }

  .time-inline input {
    height: 40px;
  }

  .time-preview {
    align-items: flex-start;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .time-preview-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .time-preview-icon svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
  }

  .checkline {
    align-items: flex-start;
  }

  .checkline input {
    margin-top: 3px;
  }

  input,
  textarea,
  select,
  .btn,
  .ghost-btn {
    font-size: 16px;
  }

  .btn,
  .ghost-btn {
    font-size: 15px;
  }

  .result-title {
    font-size: 15px;
  }

  .capsule-key {
    font-size: 12px;
  }

  .about-modal,
  .confirm-sheet {
    width: min(100vw - 18px, 100vw);
    border-radius: 18px;
  }

  .about-modal {
    padding: 12px;
  }

  .about-modal-head h3 {
    font-size: 15px;
  }

  .about-modal-body p {
    font-size: 12px;
    line-height: 1.65;
  }

  .confirm-sheet {
    padding: 14px;
  }

  .confirm-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .confirm-actions .btn,
  .confirm-actions .btn-light,
  .confirm-actions .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .public-toolbar {
    flex-wrap: wrap;
  }
}
@media (max-width: 560px) {
  .site-topbar {
    padding: 8px 10px;
  }

  .site-brand-mark,
  .admin-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .site-brand-copy strong,
  .admin-brand-copy strong {
    font-size: 13px;
  }

  .site-brand-copy span,
  .admin-brand-copy span {
    font-size: 10px;
  }

  .site-bottom-nav {
    left: 8px;
    right: 8px;
    border-radius: 18px;
  }

  .site-bottom-nav .nav-chip {
    min-height: 40px;
    font-size: 10px;
  }

  .action-card h3 {
    font-size: 17px;
  }

  .action-card p,
  .guard-item p,
  .public-item pre {
    font-size: 12px;
  }

  .guard-grid {
    gap: 10px;
  }

  .segment {
    min-height: 56px;
  }

  .segment small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .public-toolbar .btn,
  .public-toolbar .btn-light {
    flex: 1 1 100%;
  }

  .stats strong {
    font-size: 22px;
  }

  .pager a {
    min-width: 32px;
    min-height: 32px;
  }

  .about-modal,
  .confirm-sheet {
    width: min(100vw - 16px, 100vw);
    border-radius: 18px;
    padding: 12px;
  }
}
@media (max-width: 420px) {
  .site-brand {
    gap: 8px;
  }

  .hero h1 {
    font-size: 21px;
  }

  .hero p {
    font-size: 12px;
  }

  .action-card {
    min-height: 118px;
    padding: 12px 10px;
  }

  .action-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 8px;
  }

  .action-card h3 {
    font-size: 16px;
  }

  .action-card p {
    font-size: 11px;
    line-height: 1.55;
  }

  .attachment-grid {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .time-btn-custom {
    grid-column: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .action-card:hover,
  .nav-chip:hover,
  .btn:hover,
  .btn-light:hover,
  .ghost-btn:hover,
  .time-btn:hover,
  .pill-btn:hover,
  .theme-card:hover,
  .copy-key:hover,
  .about-open:hover,
  .about-close:hover,
  .segment:hover,
  .admin-menu-button:hover,
  .admin-nav-link:hover {
    transform: none;
  }

  .open-ceremony,
  .open-ceremony-seal,
  .open-ceremony-progress span,
  .open-ceremony::before,
  .result-reveal,
  .tc-pulse,
  .tc-rise,
  .tc-sheen {
    animation: none !important;
  }
}

html.is-keyboard-open .site-bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(120%);
}

html.is-keyboard-open .admin-sidebar {
  height: calc(100dvh - var(--tc-safe-top) - 24px);
}

