/*
 * Desktop workspace layer
 *
 * The production app keeps one React state tree and one set of business actions.
 * This stylesheet only changes composition and interaction affordances once a
 * browser has desktop-sized space. Mobile remains owned by prototype.css and
 * mobile-v2.css.
 */

@media (min-width: 900px) {
  :root {
    --desktop-canvas: #eef3f2;
    --desktop-surface: rgba(255, 255, 255, 0.96);
    --desktop-border: rgba(36, 77, 72, 0.11);
    --desktop-shadow: 0 16px 42px rgba(31, 62, 58, 0.08);
    --desktop-shadow-soft: 0 8px 24px rgba(31, 62, 58, 0.055);
  }

  html,
  body,
  #root {
    background: var(--desktop-canvas);
  }

  html body .phone-stage {
    width: 100%;
    height: 100dvh;
    min-height: 100%;
    padding: 0;
    background:
      radial-gradient(circle at 12% -12%, rgba(185, 239, 22, 0.11), transparent 30%),
      linear-gradient(180deg, #f7faf9 0, var(--desktop-canvas) 280px);
  }

  html body .phone-scale-box {
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    margin: 0 !important;
  }

  html body .phone-device,
  html body .device-screen,
  html body .mobile-app-viewport,
  html body .mobile-page {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }

  html body .device-screen {
    overflow: visible;
    background: transparent;
    box-shadow: none !important;
  }

  html body .mobile-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-color: rgba(52, 82, 77, 0.28) transparent;
    scrollbar-width: thin;
    touch-action: pan-y;
    user-select: auto;
  }

  html body .mobile-scroll::-webkit-scrollbar {
    display: block;
    width: 12px;
  }

  html body .mobile-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  html body .mobile-scroll::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(52, 82, 77, 0.26);
    background-clip: padding-box;
  }

  html body .mobile-scrollbar {
    display: none;
  }

  html body .app-screen {
    background: transparent;
  }

  html body .dashboard-screen {
    width: min(calc(100% - 64px), 1480px);
    min-height: 100%;
    margin: 0 auto;
    padding: 0 0 72px;
  }

  html body .product-header {
    position: sticky;
    z-index: 40;
    top: 0;
    min-height: 76px;
    margin: 0 calc(50% - 50vw) 24px;
    padding: 14px max(32px, calc((100vw - 1480px) / 2));
    border-bottom: 1px solid rgba(36, 77, 72, 0.09);
    background: rgba(248, 251, 250, 0.9);
    box-shadow: 0 6px 22px rgba(31, 62, 58, 0.045);
    backdrop-filter: blur(18px) saturate(1.15);
  }

  html body .brand-lockup {
    gap: 12px;
  }

  html body .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    box-shadow: 0 8px 18px rgba(111, 151, 12, 0.18);
  }

  html body .brand-lockup h1 {
    font-size: 22px;
    letter-spacing: -0.015em;
  }

  html body .brand-lockup p {
    margin-top: 4px;
    font-size: 13px;
  }

  html body .header-actions {
    gap: 10px;
  }

  html body .coffee-button,
  html body .more-button {
    min-height: 42px;
    padding-inline: 15px;
    border-radius: 12px;
    font-size: 13px;
    transition:
      border-color 150ms ease,
      background-color 150ms ease,
      box-shadow 150ms ease,
      transform 150ms ease;
  }

  html body .coffee-button {
    border-color: #e8cfaa;
    box-shadow: 0 4px 12px rgba(138, 87, 29, 0.07);
  }

  html body .more-button {
    border-color: rgba(36, 77, 72, 0.13);
    background: rgba(255, 255, 255, 0.88);
  }

  html body .more-menu {
    min-width: 228px;
    padding: 8px;
    border-radius: 17px;
  }

  html body .more-menu-item {
    min-height: 46px;
    border-radius: 11px;
  }

  html body .service-line {
    min-height: 48px;
    gap: 9px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--desktop-border);
    border-radius: 14px;
    background: var(--desktop-surface);
    box-shadow: var(--desktop-shadow-soft);
    font-size: 12px;
  }

  html body .service-line strong {
    font-size: 13px;
    font-weight: 700;
  }

  html body .service-line button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    transition: background-color 150ms ease, color 150ms ease;
  }

  html body .weather-notice {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: var(--desktop-shadow-soft);
  }

  html body .metric-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    min-height: 0;
    margin-top: 18px;
    overflow: visible;
    border-radius: 0;
    background: transparent;
  }

  html body .metric {
    display: grid;
    min-height: 116px;
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "icon value"
      "icon label";
    align-content: center;
    align-items: center;
    column-gap: 14px;
    padding: 20px;
    border: 1px solid var(--desktop-border);
    border-radius: 17px;
    background: var(--desktop-surface);
    box-shadow: var(--desktop-shadow-soft);
    text-align: left;
  }

  html body .metric + .metric::before {
    display: none;
  }

  html body .metric-icon {
    display: grid;
    width: 50px;
    height: 50px;
    grid-area: icon;
    place-items: center;
    border-radius: 15px;
  }

  html body .metric-teal .metric-icon {
    background: rgba(6, 155, 152, 0.11);
  }

  html body .metric-blue .metric-icon {
    background: rgba(23, 105, 219, 0.1);
  }

  html body .metric-green .metric-icon {
    background: rgba(44, 166, 43, 0.1);
  }

  html body .metric strong {
    grid-area: value;
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
  }

  html body .metric span {
    grid-area: label;
    margin: 4px 0 0;
    color: #52615e;
    font-size: 13px;
  }

  html body .create-card,
  html body .venue-section {
    border: 1px solid var(--desktop-border);
    border-radius: 20px;
    background: var(--desktop-surface);
    box-shadow: var(--desktop-shadow);
  }

  html body .create-card {
    margin-top: 24px;
    padding: 24px;
    border-color: rgba(6, 155, 152, 0.22);
    background:
      radial-gradient(circle at 18% 0, rgba(185, 239, 22, 0.1), transparent 35%),
      linear-gradient(150deg, #f9fdfc 0, #eef9f7 100%);
  }

  html body .create-card-main {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 124px;
    gap: 8px;
  }

  html body .lulu-stage {
    width: 96px;
  }

  html body .create-copy h2 {
    font-size: 25px;
    letter-spacing: -0.02em;
  }

  html body .feature-line {
    gap: 7px;
    margin-top: 11px;
    font-size: 12px;
  }

  html body .create-copy > p {
    margin-top: 10px;
    font-size: 12px;
  }

  html body .identity-row {
    min-height: 42px;
    margin-top: 10px;
    font-size: 12px;
  }

  html body .identity-row button,
  html body .sheet-identity button {
    min-height: 36px;
    padding-inline: 10px;
    border-radius: 9px;
    font-size: 12px;
  }

  html body .create-card .tier-row {
    margin: 12px 0 0;
    border-radius: 14px;
  }

  html body .create-card .quota-card {
    margin-top: 12px;
    border-radius: 14px;
  }

  html body .primary-button {
    min-height: 50px;
    margin-top: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(6, 135, 132, 0.19);
    transition:
      background-color 150ms ease,
      box-shadow 150ms ease,
      transform 150ms ease;
  }

  html body .venue-section {
    margin-top: 28px;
    padding: 24px;
  }

  html body .section-heading {
    padding: 0 0 14px;
  }

  html body .section-heading h2 {
    font-size: 22px;
    letter-spacing: -0.015em;
  }

  html body .section-heading p {
    margin-top: 5px;
    font-size: 12px;
  }

  html body .section-heading > span {
    padding: 7px 10px;
    border: 1px solid rgba(36, 77, 72, 0.1);
    border-radius: 999px;
    background: #f6f9f8;
    font-size: 11px;
  }

  html body .venue-card-legend {
    gap: 8px 16px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #f5f8f7;
    font-size: 11px;
  }

  html body .venue-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
  }

  html body .venue-card {
    min-height: 152px;
    padding: 14px;
    border-color: rgba(36, 77, 72, 0.12);
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(31, 62, 58, 0.025);
    transition:
      border-color 150ms ease,
      background-color 150ms ease,
      box-shadow 150ms ease,
      transform 150ms ease;
  }

  html body .venue-card-heading {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    min-height: 42px;
    gap: 9px;
  }

  html body .venue-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  html body .venue-card-name {
    font-size: 14px;
    line-height: 1.3;
  }

  html body .venue-card-action {
    min-width: 28px;
    height: 28px;
    padding-inline: 7px;
    font-size: 12px;
  }

  html body .venue-card-status {
    gap: 6px;
    margin-top: 9px;
  }

  html body .venue-card-status strong,
  html body .venue-card-status small,
  html body .venue-card-meta,
  html body .venue-card-mail {
    font-size: 11px;
  }

  html body .venue-card-meta {
    padding-top: 10px;
  }

  html body .venue-card-mail {
    margin-top: 7px;
  }

  html body .app-toast {
    position: fixed;
    right: auto;
    bottom: 32px;
    left: 50%;
    width: max-content;
    max-width: min(560px, calc(100vw - 64px));
    padding: 13px 18px;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(20, 25, 35, 0.22);
    font-size: 13px;
    transform: translateX(-50%);
  }

  html body .subscription-celebration {
    left: 0;
    width: 100%;
    transform: none;
  }

  html body .sheet-overlay {
    position: fixed;
    z-index: 240;
    inset: 0;
    background: rgba(17, 28, 27, 0.42);
    backdrop-filter: blur(8px) saturate(0.9);
  }

  html body .bottom-sheet {
    position: fixed;
    z-index: 250;
    top: clamp(40px, 7vh, 72px) !important;
    right: max(32px, calc((100vw - 780px) / 2)) !important;
    bottom: auto !important;
    left: max(32px, calc((100vw - 780px) / 2)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 96px) !important;
    border: 1px solid rgba(36, 77, 72, 0.13);
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
      0 30px 90px rgba(17, 28, 27, 0.28),
      0 8px 28px rgba(17, 28, 27, 0.12);
    touch-action: auto;
  }

  html body .bottom-sheet:has(.subscription-form),
  html body .bottom-sheet:has(.ops-panel) {
    right: max(32px, calc((100vw - 1040px) / 2)) !important;
    left: max(32px, calc((100vw - 1040px) / 2)) !important;
  }

  html body .bottom-sheet:has(.coffee-panel) {
    right: max(32px, calc((100vw - 620px) / 2)) !important;
    left: max(32px, calc((100vw - 620px) / 2)) !important;
  }

  html body .sheet-handle-zone {
    height: 14px;
    cursor: default;
    touch-action: auto;
  }

  html body .sheet-handle {
    display: none;
  }

  html body .sheet-header {
    gap: 6px;
    padding: 18px 32px 20px;
    border-bottom: 1px solid rgba(36, 77, 72, 0.09);
    background: linear-gradient(180deg, #fbfdfc, #ffffff);
  }

  html body .sheet-title {
    font-size: 24px;
    letter-spacing: -0.02em;
  }

  html body .sheet-description {
    font-size: 13px;
  }

  html body .sheet-content {
    padding: 24px 32px 32px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 20px 32px;
  }

  html body .sheet-content::-webkit-scrollbar {
    width: 10px;
  }

  html body .sheet-content::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(52, 82, 77, 0.24);
    background-clip: padding-box;
  }

  html body .subscription-form {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 16px;
  }

  html body .subscription-form > .sheet-identity,
  html body .subscription-form > .subscription-limit-notice,
  html body .subscription-form > fieldset:first-of-type,
  html body .subscription-form > fieldset:nth-of-type(4),
  html body .subscription-form > .subscription-summary,
  html body .subscription-form > .form-error,
  html body .subscription-form > .form-notice,
  html body .subscription-form > .sheet-primary {
    grid-column: 1 / -1;
  }

  html body .subscription-form > fieldset {
    min-width: 0;
    padding: 17px;
    border: 1px solid rgba(36, 77, 72, 0.1);
    border-radius: 15px;
    background: #fbfdfc;
  }

  html body .subscription-form legend {
    margin-bottom: 11px;
    font-size: 15px;
  }

  html body .sheet-identity {
    min-height: 50px;
    padding: 11px 14px;
    border-radius: 12px;
  }

  html body .venue-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  html body .venue-choices button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: flex-start;
    padding-inline: 12px;
  }

  html body .venue-choices button span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .weekday-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body .weekday-presets button {
    width: 100%;
  }

  html body .weekday-choices {
    gap: 7px;
  }

  html body .time-range select,
  html body .field input {
    height: 48px;
    border-radius: 10px;
  }

  html body .day-choices {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  html body .day-choices button {
    width: 100%;
    min-height: 42px;
  }

  html body .subscription-summary {
    padding: 14px 16px;
    border-radius: 13px;
  }

  html body .sheet-primary {
    min-height: 52px;
    border-radius: 12px;
  }

  html body .verification-form {
    width: min(100%, 540px);
    margin: 0 auto;
    gap: 18px;
  }

  html body .help-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  html body .help-row {
    min-height: 124px;
    padding: 16px;
    border: 1px solid rgba(36, 77, 72, 0.1);
    border-radius: 14px;
    background: #fbfdfc;
  }

  html body .help-row:last-child {
    grid-column: 1 / -1;
    min-height: 0;
  }

  html body .subscription-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  html body .subscription-list article {
    min-height: 132px;
    padding: 16px;
    border: 1px solid rgba(36, 77, 72, 0.1);
    border-radius: 14px;
    background: #fbfdfc;
  }

  html body .subscription-list .empty-state,
  html body .subscription-list > .form-error {
    grid-column: 1 / -1;
  }

  html body .priority-panel,
  html body .ops-panel {
    gap: 18px;
  }

  html body .coffee-panel {
    width: min(100%, 520px);
    margin: 0 auto;
    gap: 15px;
  }

  html body .coffee-qr-frame {
    width: min(100%, 420px);
  }
}

@media (min-width: 1180px) {
  html body .dashboard-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-auto-flow: row dense;
    align-items: start;
    gap: 18px 24px;
  }

  html body .product-header,
  html body .service-line,
  html body .weather-notice,
  html body .metric-band {
    grid-column: 1 / -1;
  }

  html body .product-header {
    margin-bottom: 6px;
  }

  html body .weather-notice,
  html body .metric-band,
  html body .create-card,
  html body .venue-section {
    margin-top: 0;
  }

  html body .create-card {
    position: sticky;
    top: 100px;
    grid-column: 2;
    align-self: start;
  }

  html body .venue-section {
    grid-column: 1;
  }

  html body .create-card-main {
    grid-template-columns: 86px minmax(0, 1fr);
    min-height: 112px;
  }

  html body .create-card .lulu-stage {
    width: 84px;
  }

  html body .create-card .feature-line {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
  }

  html body .create-card .feature-line i {
    display: none;
  }

  html body .create-card .feature-line span {
    min-width: 0;
  }
}

@media (min-width: 1500px) {
  html body .dashboard-screen {
    grid-template-columns: minmax(0, 1fr) 392px;
  }

  html body .venue-grid {
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  }
}

@media (min-width: 900px) and (hover: hover) {
  html body .coffee-button:hover,
  html body .more-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(31, 62, 58, 0.1);
  }

  html body .service-line button:hover {
    background: #eef6f4;
    color: var(--teal-dark);
  }

  html body .primary-button:hover {
    background: var(--teal-dark);
    box-shadow: 0 13px 26px rgba(6, 123, 120, 0.24);
    transform: translateY(-1px);
  }

  html body .venue-card:hover {
    border-color: rgba(6, 155, 152, 0.42);
    background: #fbfefd;
    box-shadow: 0 12px 26px rgba(31, 62, 58, 0.11);
    transform: translateY(-2px);
  }

  html body .venue-card:hover .venue-card-action.is-add {
    background: var(--teal);
    color: #ffffff;
  }
}

@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  html body .coffee-button,
  html body .more-button,
  html body .primary-button,
  html body .venue-card {
    transition: none;
  }
}
