:root {
      --bg: #070709;
      --header-bg: #0d0d10;
      --panel: #111114;
      --panel-2: #16161a;
      --panel-hover: #1c1c22;
      --line: #22222a;
      --line-soft: #181820;
      --text: #f3f4f6;
      --text-dim: #9ca3af;
      --text-faint: #6b7280;
      --primary: #3b82f6;
      --primary-hover: #2563eb;
      --primary-glass: rgba(59, 130, 246, 0.12);
      --mint: #10b981;
      --orange: #f97316;
      --yellow: #eab308;
      --red: #ef4444;
      --pink: #ec4899;
      --safe: #10b981;
      --warn: #eab308;
      --danger: #ef4444;
    }

    * {
      box-sizing: border-box;
      border-radius: 0 !important; /* All boxes straight rectangle */
      -webkit-tap-highlight-color: transparent;
    }

    html {
      scroll-behavior: smooth;
    }

    html,
    body {
      margin: 0;
      padding: 0;
      background: var(--bg);
      min-height: 100vh;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    body {
      color: var(--text);
      font-family: 'Inter', -apple-system, sans-serif;
      font-weight: 400;
      background-color: var(--bg);
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
      background-size: 32px 32px;
      padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
      min-height: 100vh;
      overflow-x: hidden;
    }

    input:focus,
    select:focus,
    button:focus-visible {
      outline: 1px solid var(--primary);
      outline-offset: 0px;
    }

    select option {
      background-color: #111114 !important;
      color: #f3f4f6 !important;
    }

    input[type=number]::-webkit-inner-spin-button,
    input[type=number]::-webkit-outer-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    input[type=number] {
      -moz-appearance: textfield;
    }

    button {
      font-family: inherit;
    }

    @keyframes fadeSlideUp {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes popIn {
      from {
        opacity: 0;
        transform: scale(.98);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .wrap {
      max-width: 960px;
      margin: 0 auto;
      padding: 0 20px 70px;
    }

    /* Motion.dev Minimal Rectangular Top Bar */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 40;
      background: var(--header-bg);
      margin: 0 -20px 24px -20px;
      padding: 14px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      border-bottom: 1px solid var(--line);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-mark-wrap {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #000000;
      border: 1px solid var(--primary);
    }

    .brand-word,
    .brand-word.top {
      font-family: 'Inter', sans-serif;
      font-weight: 800 !important;
      font-size: 19px;
      color: #ffffff;
      letter-spacing: -.03em;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .topbar-btn {
      padding: 8px 14px;
      border: 1px solid var(--line);
      background: var(--panel-2);
      color: var(--text-dim);
      cursor: pointer;
      font-size: 12.5px;
      font-weight: 400;
      white-space: nowrap;
      transition: all .15s ease;
    }

    .topbar-btn:hover {
      background: var(--panel-hover);
      color: var(--text);
      border-color: var(--pink);
    }

    .topbar-btn.primary {
      background: var(--primary);
      color: #ffffff;
      border-color: var(--primary);
      font-weight: 500;
    }

    .topbar-btn.primary:hover {
      background: var(--primary-hover);
      border-color: var(--primary-hover);
    }

    /* Auth Shell */
    .auth-shell {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .auth-card {
      width: 100%;
      max-width: 380px;
      background: var(--panel);
      border: 1px solid var(--line);
      padding: 28px 24px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      animation: fadeSlideUp .3s ease both;
    }

    .auth-title {
      font-size: 19px;
      font-weight: 600;
      margin: 6px 0 0;
      color: var(--text);
      letter-spacing: -.01em;
    }

    .auth-sub {
      font-size: 13px;
      color: var(--text-dim);
      margin: -4px 0 4px;
      line-height: 1.45;
      font-weight: 300;
    }

    .field-wrap {
      position: relative;
    }

    .auth-input {
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 13px;
      font-weight: 400;
      padding: 10px 12px;
      width: 100%;
      transition: border-color .15s ease;
    }

    .auth-input:focus {
      border-color: var(--pink);
    }

    .field-wrap .auth-input {
      padding-right: 40px;
    }

    .eye-btn {
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
      width: 28px;
      height: 28px;
      border: none;
      background: none;
      color: var(--text-faint);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: color .15s ease;
    }

    .eye-btn:hover {
      color: var(--text-dim);
    }

    .auth-submit {
      margin-top: 4px;
      padding: 10.5px 0;
      border: 1px solid var(--primary);
      cursor: pointer;
      background: var(--primary);
      color: #ffffff;
      font-size: 13px;
      font-weight: 500;
      transition: all .15s ease;
    }

    .auth-submit:hover:not(:disabled) {
      background: var(--primary-hover);
    }

    .auth-submit:active:not(:disabled) {
      opacity: .9;
    }

    .auth-submit:disabled {
      opacity: .5;
      cursor: default;
    }

    .auth-google-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      padding: 10px 0;
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 13px;
      font-weight: 400;
      cursor: pointer;
      transition: background .15s ease, border-color .15s ease;
    }

    .auth-google-btn:hover:not(:disabled) {
      background: var(--panel-hover);
      border-color: var(--pink);
    }

    .auth-divider {
      display: flex;
      align-items: center;
      text-align: center;
      color: var(--text-faint);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin: 2px 0;
      font-weight: 400;
    }

    .auth-divider::before,
    .auth-divider::after {
      content: '';
      flex: 1;
      border-bottom: 1px solid var(--line);
    }

    .auth-divider span {
      padding: 0 10px;
    }

    .auth-links {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .link-btn {
      background: none;
      border: none;
      color: var(--primary);
      font-size: 12px;
      font-weight: 400;
      cursor: pointer;
      padding: 2px;
      transition: opacity .15s ease;
    }

    .link-btn:hover {
      opacity: .8;
      text-decoration: underline;
    }

    .link-btn.muted {
      color: var(--text-dim);
    }

    .auth-msg {
      font-size: 12px;
      padding: 9px 12px;
      line-height: 1.4;
      font-weight: 400;
      animation: popIn .2s ease both;
    }

    .auth-msg.error {
      color: #ffffff;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.4);
    }

    .auth-msg.info {
      color: var(--safe);
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    /* User bar */
    .userbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 20px;
      padding: 10px 14px;
      background: var(--panel);
      border: 1px solid var(--line);
      flex-wrap: wrap;
    }

    .user-pill {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .avatar-dot {
      width: 6px;
      height: 6px;
      background: var(--pink);
    }

    .email {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 300;
      color: var(--text-dim);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 220px;
    }

    .userbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ghost-btn {
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text-dim);
      padding: 6px 11px;
      font-size: 11.5px;
      font-weight: 400;
      cursor: pointer;
      flex-shrink: 0;
      transition: all .15s ease;
    }

    .ghost-btn:hover {
      border-color: var(--orange);
      color: var(--text);
      background: var(--panel-hover);
    }

    .ghost-btn.danger:hover {
      border-color: var(--red);
      color: var(--red);
      background: rgba(239, 68, 68, 0.08);
    }

    .status-banner {
      font-size: 12.5px;
      font-weight: 500;
      color: #ffffff;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.4);
      padding: 10px 14px;
      margin-bottom: 18px;
      animation: popIn .2s ease both;
      line-height: 1.45;
    }

    /* Minimal Rectangular Overall Card */
    .overall {
      background: var(--panel);
      border: 1px solid var(--line);
      color: var(--text);
      padding: 22px;
      display: flex;
      align-items: center;
      gap: 20px;
      margin-bottom: 20px;
      flex-wrap: wrap;
      animation: fadeSlideUp .3s ease both;
    }

    .overall-text {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
      flex: 1;
    }

    .overall-label {
      font-size: 11px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--pink);
      font-weight: 600;
    }

    .overall-main {
      font-size: 17px;
      font-weight: 500;
      color: var(--text);
      letter-spacing: -.01em;
    }

    .overall-sub {
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      color: var(--text-dim);
      font-weight: 300;
    }

    /* Days Navigation Bar - Minimal Rectangular Tabs */
    .days-nav-section {
      margin-bottom: 20px;
      width: 100%;
    }

    /* Pill Nav Container & GSAP Sliding Pill Indicator */
    .pill-nav-wrap {
      position: relative;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      background: rgba(18, 18, 22, 0.85);
      border: 1px solid var(--line);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      width: 100%;
      overflow-x: auto;
      scrollbar-width: none;
    }

    .pill-nav-wrap::-webkit-scrollbar {
      display: none;
    }

    .pill-indicator {
      position: absolute;
      top: 4px;
      height: calc(100% - 8px);
      background: var(--pink);
      border: 1px solid rgba(236, 72, 153, 0.5);
      box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
      z-index: 1;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }

    .day-tab {
      position: relative;
      z-index: 2;
      flex: 1 1 0px;
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 9px 6px;
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-dim);
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: color .2s ease;
      text-align: center;
    }

    .day-tab:hover {
      color: #ffffff;
    }

    .day-tab.active {
      color: #ffffff;
      font-weight: 700;
    }

    .day-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10.5px;
      font-weight: 400;
      padding: 1px 5px;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-faint);
    }

    .day-tab.active .day-badge {
      background: rgba(255, 255, 255, 0.25);
      color: #ffffff;
    }

    @media (max-width: 640px) {
      .pill-nav-wrap {
        padding: 3px;
        gap: 2px;
      }
      .day-tab {
        padding: 8px 3px;
        font-size: 11px;
        gap: 3px;
      }
      .day-badge {
        font-size: 9.5px;
        padding: 0 4px;
      }
    }

    .day-action-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      padding: 10px 14px;
      background: var(--panel);
      border: 1px solid var(--line);
      flex-wrap: wrap;
      gap: 10px;
    }

    .day-action-title {
      font-size: 14.5px;
      font-weight: 600;
      color: var(--text);
    }

    .addbtn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border: 1px solid var(--line);
      background: var(--panel-2);
      color: var(--text-dim);
      cursor: pointer;
      font-size: 12px;
      font-weight: 400;
      white-space: nowrap;
      transition: all .15s ease;
    }

    .addbtn:hover {
      border-color: var(--pink);
      background: var(--panel-hover);
      color: var(--text);
    }

    .addbtn.primary-action {
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
      font-weight: 500;
    }

    .addbtn.primary-action:hover {
      background: var(--primary-hover);
      border-color: var(--primary-hover);
    }

    .empty {
      border: 1px dashed var(--line);
      padding: 40px 20px;
      text-align: center;
      color: var(--text-dim);
      font-size: 13.5px;
      font-weight: 300;
      animation: fadeSlideUp .3s ease both;
      background: var(--panel);
    }

    /* Days Checklist UI inside Add Form */
    .days-checklist-box {
      background: var(--panel-2);
      border: 1px solid var(--line);
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .days-checklist-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 500;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    .days-checklist-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
    }

    .day-check-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 9px;
      background: var(--panel);
      border: 1px solid var(--line);
      color: var(--text-dim);
      font-size: 12px;
      font-weight: 400;
      cursor: pointer;
      transition: all .15s ease;
      user-select: none;
    }

    .day-check-item:hover {
      background: var(--panel-hover);
      border-color: var(--pink);
      color: var(--text);
    }

    .day-check-item input[type="checkbox"] {
      accent-color: var(--pink);
      width: 14px;
      height: 14px;
      cursor: pointer;
    }

    .day-check-item.checked {
      background: rgba(236, 72, 153, 0.12);
      border-color: var(--pink);
      color: var(--pink);
    }

    /* Apple Style Dock for Subject Cards Grid */
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 16px;
      padding: 16px;
      background: rgba(18, 18, 22, 0.7);
      border: 1px solid rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .card {
      background: #111114;
      border: 1px solid var(--line);
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      position: relative;
      transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), border-color .2s ease, box-shadow .25s ease;
    }

    @media (hover:hover) and (pointer:fine) {
      .card:hover {
        border-color: var(--pink);
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 12px 28px rgba(236, 72, 153, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
        z-index: 5;
      }
    }

    .card.reveal {
      animation: fadeSlideUp .3s ease both;
    }

    /* Animated List (Mobile View < 640px) */
    @media (max-width: 639px) {
      .animated-list-wrap {
        position: relative;
        padding: 4px 0;
        /* showGradients: true */
        mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
      }

      .animated-list-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        max-height: 72vh;
        overflow-y: auto;
        padding: 8px 4px;
        -webkit-overflow-scrolling: touch;
        /* displayScrollbar: true */
        scrollbar-width: thin;
        scrollbar-color: rgba(236, 72, 153, 0.4) rgba(0, 0, 0, 0.2);
      }

      .animated-list-grid::-webkit-scrollbar {
        width: 4px;
      }

      .animated-list-grid::-webkit-scrollbar-thumb {
        background: rgba(236, 72, 153, 0.4);
      }

      .animated-list-item {
        background: #111114;
        border: 1px solid var(--line);
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        transition: transform .2s ease, border-color .2s ease;
      }

      .animated-list-item:active {
        transform: scale(0.98);
        border-color: var(--pink);
      }
    }

    .card-top-actions {
      position: absolute;
      top: 8px;
      right: 8px;
      display: flex;
      align-items: center;
      gap: 4px;
      z-index: 2;
    }

    .card-action-btn {
      background: none;
      border: none;
      color: var(--text-faint);
      cursor: pointer;
      padding: 4px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: color .15s ease, transform .15s ease;
    }

    .card-action-btn:hover {
      color: var(--text);
    }

    .card-action-btn.edit-btn:hover {
      color: var(--primary);
    }

    .card-action-btn.remove-btn:hover {
      color: var(--red);
    }

    .card-head {
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .card-name {
      font-size: 15px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 140px;
    }

    .notif-toggle-btn {
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text-dim);
      font-size: 10px;
      font-weight: 500;
      padding: 0 8px;
      height: 22px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      margin-top: 4px;
      vertical-align: middle;
      transition: all .15s ease;
    }

    .notif-toggle-btn svg {
      flex-shrink: 0;
    }

    .notif-toggle-btn:hover {
      border-color: var(--pink);
      color: var(--text);
    }

    .notif-toggle-btn.active {
      background: rgba(16, 185, 129, 0.12);
      border-color: rgba(16, 185, 129, 0.35);
      color: var(--safe);
    }

    /* Classy Minimal Tags (Orange & Pink) */
    .tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-top: 4px;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .04em;
      text-transform: uppercase;
      padding: 0 7px;
      height: 22px;
      vertical-align: middle;
    }

    .tag.theory {
      color: var(--orange);
      background: rgba(249, 115, 22, 0.1);
      border: 1px solid rgba(249, 115, 22, 0.25);
    }

    .tag.lab {
      color: var(--pink);
      background: rgba(236, 72, 153, 0.1);
      border: 1px solid rgba(236, 72, 153, 0.25);
    }

    .steppers {
      display: flex;
      flex-direction: column;
      gap: 8px;
      border-top: 1px solid var(--line-soft);
      padding-top: 10px;
    }

    .stepper {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .stepper .label {
      font-size: 12px;
      color: var(--text-dim);
      font-weight: 400;
    }

    .stepper .controls {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .stepbtn {
      width: 28px;
      height: 28px;
      border: 1px solid var(--line);
      background: var(--panel-2);
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
      font-weight: 400;
      touch-action: manipulation;
      transition: all .15s ease;
    }

    @media (hover:hover) and (pointer:fine) {
      .stepbtn:hover {
        border-color: var(--pink);
        background: var(--pink);
        color: #ffffff;
      }
    }

    .stepbtn:active {
      transform: scale(.92);
    }

    .stepval {
      font-family: 'JetBrains Mono', monospace;
      font-size: 13.5px;
      font-weight: 500;
      width: 24px;
      text-align: center;
      transition: color .2s ease;
    }

    .bump {
      animation: popIn .2s ease both;
    }

    .minrow {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid var(--line-soft);
      padding-top: 10px;
      margin-bottom: 8px;
    }

    .minrow .lbl {
      font-size: 12px;
      color: var(--text-dim);
      font-weight: 400;
    }

    .mininput-wrap {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .mininput {
      width: 48px;
      height: 26px;
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text);
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      font-weight: 500;
      text-align: center;
      padding: 2px 4px;
      transition: border-color .15s ease;
    }

    .mininput:focus {
      border-color: var(--pink);
    }

    .pct-sign {
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      color: var(--text-dim);
    }

    .message {
      font-size: 12px;
      font-weight: 400;
      margin-top: 6px;
      line-height: 1.35;
      transition: color .2s ease;
    }

    .ring-wrap {
      position: relative;
      flex-shrink: 0;
    }

    .ring-num {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      pointer-events: none;
    }

    .ring-num .n {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 600;
      color: var(--text);
      display: block;
      line-height: 1;
    }

    .ring-num .l {
      font-family: 'Inter', sans-serif;
      font-weight: 400;
      color: var(--text-faint);
      display: block;
      margin-top: 2px;
    }

    /* Form Overlay */
    .panel-form {
      background: var(--panel);
      border: 1px solid var(--line);
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 20px;
      max-width: 440px;
      animation: fadeSlideUp .25s ease both;
    }

    .panel-form-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .panel-form-head span {
      font-size: 15px;
      font-weight: 600;
    }

    .panel-form-head button {
      background: none;
      border: none;
      color: var(--text-faint);
      cursor: pointer;
      padding: 4px;
      font-size: 15px;
      font-weight: 400;
      transition: color .15s ease;
    }

    .panel-form-head button:hover {
      color: var(--text);
    }

    .panel-form input[type=text],
    .modal-card input[type=text],
    input[type=text] {
      background: var(--panel-2);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 13px;
      font-weight: 400;
      padding: 10px 12px;
      width: 100%;
      outline: none;
      transition: border-color .15s ease;
    }

    .panel-form input[type=text]:focus,
    .modal-card input[type=text]:focus,
    input[type=text]:focus {
      border-color: var(--pink);
    }

    /* Custom 12-Hour Time Picker & AM/PM Scroller */
    .time-picker-box {
      background: var(--panel-2);
      border: 1px solid var(--line);
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .time-picker-title {
      font-size: 11px;
      font-weight: 500;
      color: var(--text-dim);
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    .time-duration-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      font-weight: 500;
      color: var(--orange);
      background: rgba(249, 115, 22, 0.12);
      padding: 2px 6px;
    }

    .time-block {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .time-block-label {
      font-size: 11.5px;
      font-weight: 400;
      color: var(--text-dim);
      width: 40px;
      flex-shrink: 0;
    }

    .time-select {
      background: #111114 !important;
      color: #f3f4f6 !important;
      border: 1px solid var(--line);
      font-family: 'JetBrains Mono', monospace;
      font-size: 12.5px;
      font-weight: 400;
      padding: 5px 7px;
      cursor: pointer;
    }

    .time-input-num {
      background: #111114 !important;
      color: #f3f4f6 !important;
      border: 1px solid var(--line);
      font-family: 'JetBrains Mono', monospace;
      font-size: 12.5px;
      font-weight: 500;
      padding: 5px 6px;
      width: 48px;
      text-align: center;
      outline: none;
      transition: border-color .15s ease;
    }

    .time-input-num:focus {
      border-color: var(--pink);
    }

    .time-input-num::-webkit-inner-spin-button,
    .time-input-num::-webkit-outer-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    .time-input-num[type=number] {
      -moz-appearance: textfield;
    }

    .ampm-toggle {
      display: flex;
      background: var(--panel);
      border: 1px solid var(--line);
      padding: 1px;
      gap: 1px;
    }

    .ampm-btn {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      font-weight: 400;
      padding: 3px 7px;
      border: none;
      background: transparent;
      color: var(--text-dim);
      cursor: pointer;
      transition: all .15s ease;
    }

    .ampm-btn.active {
      background: var(--pink);
      color: #ffffff;
      font-weight: 600;
    }

    /* Fixed Rectangular Modal Overlay for Upload Schedule */
    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 100;
      background: rgba(0, 0, 0, 0.85);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      animation: fadeSlideUp .2s ease both;
    }

    .modal-card {
      width: 100%;
      max-width: 460px;
      max-height: 85vh;
      overflow-y: auto;
      background: #111114;
      border: 1px solid var(--line);
      padding: 22px;
      position: relative;
    }

    /* Timetable Upload Zone */
    .upload-zone {
      border: 1px dashed var(--line);
      padding: 24px 16px;
      text-align: center;
      background: var(--panel-2);
      cursor: pointer;
      transition: all .15s ease;
      display: block;
      margin-top: 12px;
    }

    .upload-zone:hover {
      border-color: var(--pink);
      background: var(--panel-hover);
    }

    .type-row {
      display: flex;
      gap: 6px;
    }

    .type-btn {
      flex: 1;
      padding: 8px 0;
      cursor: pointer;
      font-size: 12px;
      font-weight: 400;
      text-transform: capitalize;
      border: 1px solid var(--line);
      background: var(--panel-2);
      color: var(--text-dim);
      transition: all .15s ease;
    }

    .type-btn.active {
      border-color: var(--pink);
      background: rgba(236, 72, 153, 0.12);
      color: var(--pink);
      font-weight: 600;
    }

    .submit-btn {
      margin-top: 4px;
      padding: 10.5px 0;
      border: 1px solid var(--primary);
      cursor: pointer;
      background: var(--primary);
      color: #ffffff;
      font-size: 13px;
      font-weight: 600;
      transition: background .15s ease;
    }

    .submit-btn:hover {
      background: var(--primary-hover);
    }

    .hidden {
      display: none !important;
    }

    .spinner {
      width: 15px;
      height: 15px;
      border-radius: 50% !important;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-top-color: #fff;
      animation: spin .7s linear infinite;
      display: inline-block;
      vertical-align: middle;
    }

    /* Merged into main html, body rule above */

    @media (max-width: 640px) {
      .wrap {
        padding: 0 12px 60px;
        min-height: 100vh;
        overflow-y: visible;
      }

      .topbar {
        margin: 0 -12px 18px;
        padding: 12px 14px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(12px);
      }

      .days-nav-section {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }

      .days-nav-section::-webkit-scrollbar {
        display: none;
      }

      .days-nav {
        min-width: max-content;
      }

      .grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 14px;
      }

      .modal-card {
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      .brand-word.top {
        font-size: 17px;
      }

      .topbar-btn {
        padding: 7px 10px;
        font-size: 11.5px;
      }

      .overall {
        padding: 16px;
        gap: 14px;
      }

      .panel-form {
        max-width: 100%;
      }

      .card-name {
        max-width: 130px;
      }

      .email {
        max-width: 130px;
      }

      .auth-card {
        padding: 22px 18px;
      }
    }
/* ==========================================================================
   MODAL & TIME-PICKER STYLES (POLISHED & RESPONSIVE)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 9, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  animation: modalFadeIn 0.18s ease-out;
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: modalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.time-picker-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.time-duration-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 7px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.time-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-block-label {
  font-size: 11.5px;
  color: var(--text-dim);
  width: 36px;
  font-weight: 500;
}

.time-select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.time-select:focus {
  border-color: var(--primary);
}

.time-input-num {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 6px 8px;
  width: 48px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.15s ease;
}

.time-input-num:focus {
  border-color: var(--primary);
}

.ampm-toggle {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-left: auto;
}

.ampm-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ampm-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.ghost-btn.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.ghost-btn.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--danger);
}
/* ==========================================================================
   ENHANCED MOBILE & COMPACT SCREEN RESPONSIVENESS (< 480px)
   ========================================================================== */

@media (max-width: 480px) {
  .wrap {
    padding: 0 10px 48px;
  }

  .topbar {
    margin: 0 -10px 14px;
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar-nav {
    gap: 6px;
  }

  .topbar-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .email {
    max-width: 100px;
    font-size: 11px;
  }

  .days-nav-section {
    margin-bottom: 14px;
  }

  .day-tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  .modal-card {
    padding: 16px 14px;
    max-height: 90vh;
    border-radius: 8px;
  }

  .time-picker-box {
    padding: 10px;
    gap: 8px;
  }

  .time-block {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
  }

  .time-block-label {
    width: 32px;
    font-size: 11px;
  }

  .time-select {
    font-size: 12px;
    padding: 5px 6px;
    min-width: 54px;
  }

  .time-input-num {
    font-size: 12px;
    padding: 5px 4px;
    width: 40px;
  }

  .ampm-btn {
    padding: 5px 8px;
    font-size: 10px;
  }

  .time-duration-badge {
    font-size: 10px;
    padding: 1px 5px;
  }

  .grid {
    padding: 8px 0;
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  .step-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .auth-card {
    padding: 18px 14px;
    width: 100%;
  }

  .auth-input {
    padding: 9px 12px;
    font-size: 13px;
  }
}
