* { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Tajawal', sans-serif;
    background: #F1EFE6;
    color: #1E2B27;
    min-height: 100vh;
    padding: 28px 14px 60px;
    display: flex;
    justify-content: center;
  }
  .wrap { width: 100%; max-width: 520px; }

  .header {
    text-align: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid #C7B87E;
  }
  .header .seal {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 2px solid #C7B87E;
    box-shadow: 0 2px 6px rgba(20,92,75,0.15);
  }
  .header .org { font-size: 13px; color: #5B6A63; font-weight: 500; }
  .header h1 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 21px;
    color: #145C4B;
    margin-top: 4px;
  }
  .header p { color: #6B6459; font-size: 13px; margin-top: 6px; }

  .docs-notice {
    background: #FBFAF5;
    border: 1.5px solid #C7B87E;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
  }
  .docs-notice-title {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #145C4B;
    margin-bottom: 8px;
  }
  .docs-list {
    margin: 0;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .docs-list li { font-size: 13px; color: #3F4B44; }

  .ticket-docs {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #2E7261;
    font-size: 12.5px;
    color: #D8E8E1;
    line-height: 1.7;
    text-align: center;
  }

  .step-label {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #145C4B;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
  }
  .step-label .n {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #145C4B;
    color: #F1EFE6;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
  }

  .card {
    background: #FBFAF5;
    border: 1px solid #DAD3C0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
  }
  .field { margin-bottom: 14px; }
  .field:last-child { margin-bottom: 0; }
  .field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #3F4B44;
    margin-bottom: 6px;
  }
  .field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #D1C9B2;
    border-radius: 8px;
    background: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    color: #1E2B27;
  }
  .field input:focus {
    outline: none;
    border-color: #145C4B;
    box-shadow: 0 0 0 3px rgba(20,92,75,0.14);
  }
  .err { color: #A83A2C; font-size: 12px; margin-top: 4px; display: none; }
  .hint-small { font-size: 12px; color: #8A8377; margin-top: 4px; }

  .btn {
    width: 100%;
    padding: 13px;
    background: #145C4B;
    color: #F1EFE6;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
  }
  .btn:active { transform: scale(0.98); }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn.secondary {
    background: transparent;
    color: #145C4B;
    border: 1.5px solid #145C4B;
  }

  .days-grid { display: flex; flex-direction: column; gap: 10px; }
  .day-opt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border: 1.5px solid #D1C9B2;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
  }
  .day-opt.selected { border-color: #145C4B; background: #EAF2EE; }
  .day-opt .d-name { font-weight: 700; font-size: 14px; }
  .day-opt .d-sub { font-size: 12px; color: #6B6459; margin-top: 2px; }
  .day-opt .d-count {
    font-size: 12px;
    font-weight: 700;
    color: #145C4B;
    background: #DCEBE4;
    padding: 3px 10px;
    border-radius: 12px;
  }

  .slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
  }
  .slot-btn {
    padding: 10px 4px;
    border: 1.5px solid #D1C9B2;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
  }
  .slot-btn.selected { border-color: #145C4B; background: #145C4B; color: #F1EFE6; }
  .slot-btn.taken { background: #EFE9DD; color: #B0A98F; cursor: not-allowed; text-decoration: line-through; border-color: #E3DCC8; }

  .divider-or {
    text-align: center;
    font-size: 12px;
    color: #9A9483;
    margin: 14px 0;
    position: relative;
  }
  .divider-or::before, .divider-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #E0D9C6;
  }
  .divider-or::before { right: 0; }
  .divider-or::after { left: 0; }

  .ticket-shell { display: none; }
  .ticket-shell.show { display: block; animation: rise 0.35s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

  .ticket {
    background: #145C4B;
    border-radius: 14px;
    padding: 24px 22px 18px;
    color: #F1EFE6;
  }
  .ticket .t-header {
    text-align: center;
    font-size: 12px;
    letter-spacing: 1px;
    color: #B9D6CB;
    margin-bottom: 4px;
  }
  .ticket .num {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 40px;
    color: #E9D9A0;
    text-align: center;
    line-height: 1;
    margin: 4px 0 16px;
  }
  .perf { border-top: 2px dashed #2E7261; margin: 4px 0 16px; }
  .ticket .rows { display: flex; flex-direction: column; gap: 10px; }
  .ticket .row { display: flex; justify-content: space-between; font-size: 14px; }
  .ticket .row .k { color: #B9D6CB; }
  .ticket .row .v { font-weight: 700; }

  .save-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: right;
    background: #FDF3DC;
    border: 2px solid #E3B94A;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(227, 185, 74, 0.25);
  }
  .save-note-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
  .save-note-text { display: flex; flex-direction: column; gap: 4px; }
  .save-note-text strong { font-size: 14px; color: #8A6A1E; font-family: 'Cairo', sans-serif; }
  .save-note-text span { font-size: 13px; color: #6B5A2E; line-height: 1.6; }
  .reset-link { text-align: center; margin-top: 14px; }
  .reset-link button { background: none; border: none; color: #6B6459; font-size: 13px; text-decoration: underline; cursor: pointer; }
  .back-link { margin-bottom: 10px; }
  .back-link button { background: none; border: none; color: #145C4B; font-size: 13px; font-weight: 700; cursor: pointer; }
  .full-notice { background: #FBEAE7; color: #A83A2C; border: 1px solid #EFC9C1; padding: 10px 14px; border-radius: 8px; font-size: 13px; text-align: center; margin-bottom: 12px; }

  /* شاشات كبيرة (تابلت وديسكتوب): توسيع بسيط وزيادة تباعد الشبكة */
  @media (min-width: 640px) {
    .wrap { max-width: 560px; }
    .slots-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .card { padding: 24px; }
  }

  /* شاشات صغيرة جداً (موبايل ضيق، أقل من 380px) */
  @media (max-width: 380px) {
    body { padding: 18px 10px 40px; }
    .card { padding: 14px; }
    .header h1 { font-size: 18px; }
    .header .seal { width: 60px; height: 60px; }
    .slots-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .slot-btn { font-size: 12px; padding: 9px 2px; }
    .day-opt { padding: 11px 12px; }
    .day-opt .d-name { font-size: 13px; }
    .ticket .num { font-size: 32px; }
    .btn { font-size: 14px; padding: 12px; }
  }

  /* شاشات عريضة جداً (ديسكتوب كبير): منع تمدد الأزرار الشبكية أكتر من اللازم */
  @media (min-width: 900px) {
    .wrap { max-width: 600px; }
  }
