@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Montserrat:wght@300;400;500;600&display=swap');
  
  :root[data-theme="sunset"] {
    --bg-color: #181714;
    --card-bg: #201D18;
    --text-muted: #827054;
    --text-main: #C8AB85;
    --accent-amber: #B87A35;
    --accent-glow: #D4A060;
    --border-soft: rgba(180, 100, 25, 0.25);
    --glow-outer: rgba(160, 80, 15, 0.22);
    --glow-inner: rgba(185, 100, 20, 0.28);
    --glass-bg: rgba(0, 0, 0, 0.2);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --btn-hover-glow: linear-gradient(135deg, #A85F24, #D4A060);
    --btn-hover-text: #181714;
  }

  :root[data-theme="night"] {
    --bg-color: #0A0C10;
    --card-bg: #11141A;
    --text-muted: #6B7B8C;
    --text-main: #B4C5D6;
    --accent-amber: #4F6B9E;
    --accent-glow: #7A9CE0;
    --border-soft: rgba(79, 107, 158, 0.25);
    --glow-outer: rgba(30, 60, 120, 0.22);
    --glow-inner: rgba(60, 100, 180, 0.28);
    --glass-bg: rgba(0, 0, 0, 0.2);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --btn-hover-glow: linear-gradient(135deg, #2B3D5C, #7A9CE0);
    --btn-hover-text: #0A0C10;
  }

  :root[data-theme="dawn"] {
    --bg-color: #F4EFE6;
    --card-bg: #FCFAF6;
    --text-muted: #8A7A6B;
    --text-main: #4A4036;
    --accent-amber: #D64545;
    --accent-glow: #E63946;
    --border-soft: rgba(214, 69, 69, 0.2);
    --glow-outer: rgba(230, 57, 70, 0.12);
    --glow-inner: rgba(214, 69, 69, 0.18);
    --glass-bg: rgba(0, 0, 0, 0.03);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --btn-hover-glow: linear-gradient(135deg, #E63946, #F1A545);
    --btn-hover-text: #FCFAF6;
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: var(--bg-color);
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 1.1s cubic-bezier(0.25, 1, 0.5, 1), color 1.1s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .warm-noise { 
    position: fixed; inset: 0; opacity: 0.055; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); 
    background-size: 180px 180px; pointer-events: none; z-index: 1; 
  }
  
  .grain-overlay { 
    position: fixed; inset: 0; 
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(150,150,150,0.03) 2px, rgba(150,150,150,0.03) 4px); 
    pointer-events: none; z-index: 1; 
  }

  .hero-glow-outer { position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%); width: 520px; height: 160px; background: radial-gradient(ellipse, var(--glow-outer) 0%, transparent 75%); pointer-events: none; z-index: 2; transition: background 1.1s ease; }
  .hero-glow-inner { position: fixed; bottom: -20px; left: 50%; transform: translateX(-50%); width: 260px; height: 80px; background: radial-gradient(ellipse, var(--glow-inner) 0%, transparent 70%); pointer-events: none; z-index: 2; transition: background 1.1s ease; }

  .nav { position: relative; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; border-bottom: 0.5px solid var(--border-soft); background: var(--glass-bg); transition: border-color 1.1s ease, background 1.1s ease; }
  .nav-logo { font-family: 'Merriweather', serif; font-size: 19px; color: var(--accent-amber); letter-spacing: 0.08em; font-weight: 700; transition: color 1.1s ease; }
  .nav-links { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
  .nav-links a { font-size: 11px; color: var(--text-muted); text-decoration: none; letter-spacing: 0.06em; font-weight: 600; text-transform: uppercase; cursor: pointer; transition: color 0.2s ease; }
  .nav-links a:hover, .nav-links a.active { color: var(--accent-glow); }

  .theme-switcher { display: flex; gap: 8px; background: var(--glass-bg); padding: 4px; border-radius: 20px; border: 0.5px solid var(--border-soft); transition: border-color 1.1s ease, background 1.1s ease; }
  .theme-btn { background: none; border: none; padding: 6px 10px; cursor: pointer; font-size: 13px; border-radius: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; opacity: 0.4; }
  .theme-btn:hover { opacity: 0.8; background: var(--hover-bg); }
  .theme-btn.active { opacity: 1; background: var(--card-bg); border: 0.5px solid var(--border-soft); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

  .site-wrap { position: relative; z-index: 5; max-width: 800px; margin: 0 auto; padding: 40px 24px 60px 24px; display: flex; flex-direction: column; min-height: calc(100vh - 80px); }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .site-section { display: none; }
  .site-section.active { display: block; animation: fadeIn 1.1s cubic-bezier(0.25, 1, 0.5, 1) forwards; }

  .home-centered { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero-title { font-family: 'Merriweather', serif; font-size: 42px; color: var(--accent-glow); font-weight: 400; line-height: 1.2; margin: 0 0 12px; transition: color 1.1s ease; }
  .hero-desc { font-size: 15px; color: var(--text-muted); max-width: 540px; line-height: 1.7; font-weight: 500; transition: color 1.1s ease; margin-bottom: 16px; }
  .section-label { font-size: 10px; color: var(--text-muted); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 16px; font-weight: 600; transition: color 1.1s ease; }

  .theme-photo-container { 
    width: 100%; 
    margin: 16px auto; 
    max-width: 340px; 
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%);
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%);
  }
  .theme-photo { 
    display: none; 
    width: 100%; 
    aspect-ratio: 4 / 5; 
    object-fit: cover; 
  }
  :root[data-theme="sunset"] .photo-sunset { display: block; }
  :root[data-theme="night"] .photo-night { display: block; }
  :root[data-theme="dawn"] .photo-dawn { display: block; }

  .action-grid { display: flex; gap: 14px; margin-top: 16px; width: 100%; max-width: 980px; justify-content: center; }
  .action-card-btn { flex: 1; padding: 22px 14px; background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 8px; color: var(--text-main); font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); text-align: center; display: flex; align-items: center; justify-content: center; min-height: 64px; }
  
  :root[data-theme="sunset"] .action-card-btn:hover { background: var(--btn-hover-glow); color: var(--btn-hover-text); border-color: var(--accent-glow); box-shadow: 0 0 24px rgba(184, 122, 53, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2); transform: translateY(-3px); }
  :root[data-theme="night"] .action-card-btn:hover { background: var(--btn-hover-glow); color: var(--btn-hover-text); border-color: var(--accent-glow); box-shadow: 0 0 26px rgba(122, 156, 224, 0.45), inset 0 0 10px rgba(255, 255, 255, 0.2); transform: translateY(-3px); }
  :root[data-theme="dawn"] .action-card-btn:hover { background: var(--btn-hover-glow); color: var(--btn-hover-text); border-color: #E63946; box-shadow: 0 4px 20px rgba(230, 57, 70, 0.3), 0 2px 30px rgba(241, 165, 69, 0.2); transform: translateY(-3px); }

  .card { background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; margin-bottom: 16px; position: relative; padding: 28px; transition: background 1.1s ease, border-color 1.1s ease; }
  .card-inner-glow { position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-amber), transparent); opacity: 0.5; transition: background 1.1s ease; }
  
  .card-header-test { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; transition: border-color 1.1s ease; }
  .card-badge { width: 36px; height: 36px; background: var(--glass-bg); border: 1px solid var(--border-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--accent-amber); flex-shrink: 0; transition: color 1.1s ease, border-color 1.1s ease, background 1.1s ease; }
  .card-title { font-size: 15px; color: var(--accent-glow); font-weight: 600; transition: color 1.1s ease; }
  .card-sub { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 4px; line-height: 1.5; transition: color 1.1s ease; }

  .catalog-grid { display: grid; gap: 16px; margin-top: 24px; }
  .clickable-card { cursor: pointer; }
  .clickable-card:hover { border-color: var(--accent-amber); background: var(--hover-bg); }
  
  #active-test-container, #active-soothing-container, #active-reflect-container { display: none; }
  
  .back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text-muted); cursor: pointer; margin-bottom: 24px; transition: all 0.3s ease; border: 1px solid transparent; background: var(--glass-bg); padding: 10px 18px; font-family: inherit; font-weight: 600; border-radius: 8px; }
  .back-btn:hover { color: var(--accent-glow); border-color: var(--border-soft); background: var(--hover-bg); transform: translateX(-4px); }

  .test-instruction { font-size: 14px; color: var(--text-main); line-height: 1.6; margin-bottom: 24px; padding: 16px; background: var(--glass-bg); border-radius: 8px; border-left: 3px solid var(--accent-amber); font-weight: 500; }
  
  .question-num { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; font-weight: 600; transition: color 1.1s ease; }
  .question-text { font-size: 16px; color: var(--text-main); line-height: 1.6; margin-bottom: 24px; min-height: 60px; display: flex; align-items: center; font-weight: 500; transition: color 1.1s ease; }
  
  .scale-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
  .scale-item { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
  .scale-item input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
  .scale-item label { width: 100%; aspect-ratio: 1; max-width: 42px; background: var(--glass-bg); border: 1px solid var(--border-soft); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-muted); transition: all 0.2s ease; cursor: pointer; font-weight: 500; }
  .scale-item input:checked + label { background: var(--hover-bg); border-color: var(--accent-amber); color: var(--accent-glow); font-weight: 700; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
  .scale-item input:focus-visible + label { outline: 2px solid var(--accent-glow); outline-offset: 2px; }
  
  .scale-hint-row { display: flex; justify-content: space-between; margin-top: 12px; }
  .scale-hint { font-size: 11px; color: var(--text-muted); font-weight: 500; transition: color 1.1s ease; }

  .v-scale { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .v-scale label { display: flex; align-items: center; padding: 14px 18px; border-radius: 8px; background: var(--glass-bg); border: 1px solid var(--border-soft); cursor: pointer; user-select: none; font-size: 15px; line-height: 1.4; transition: all 0.2s ease; text-align: left; font-weight: 500; color: var(--text-main); }
  .v-scale input { display: none; }
  .v-scale input:checked + label { background: var(--hover-bg); border-color: var(--accent-amber); color: var(--accent-glow); font-weight: 600; box-shadow: 0 0 10px rgba(0,0,0,0.05); }
  .v-scale label:hover { background: var(--hover-bg); }

  .input-group { margin: 24px 0; }
  .input-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
  .input-group input, textarea { width: 100%; background: var(--glass-bg); border: 1px solid var(--border-soft); padding: 12px 14px; border-radius: 6px; color: var(--text-main); font-size: 14px; outline: none; transition: border-color 0.2s, color 1.1s ease, background 1.1s ease; font-family: inherit; resize: vertical; }
  .input-group input:focus, textarea:focus { border-color: var(--accent-amber); }

  .wizard-inputs { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; width: 100%; max-width: 500px; margin-left: auto; margin-right: auto; }
  .wizard-inputs input, .wizard-inputs textarea { background: var(--glass-bg); border: 1px solid var(--border-soft); padding: 14px; border-radius: 8px; color: var(--text-main); font-size: 15px; outline: none; transition: border-color 0.2s, background 1.1s ease; font-family: inherit; width: 100%; text-align: center; }
  .wizard-inputs input:focus, .wizard-inputs textarea:focus { border-color: var(--accent-amber); }
  .wizard-inputs textarea { text-align: left; min-height: 80px; resize: none; }

  .controls { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
  button { background: transparent; border: 1px solid var(--accent-amber); padding: 12px 20px; border-radius: 6px; color: var(--accent-glow); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; font-family: inherit; }
  button:hover:not(:disabled) { background: var(--accent-amber); color: var(--bg-color); }
  button:disabled { opacity: 0.3; cursor: not-allowed; }
  .btn-ghost { background: transparent; border-color: var(--border-soft); color: var(--text-muted); }
  .btn-ghost:hover:not(:disabled) { border-color: var(--accent-amber); color: var(--text-main); }

  .feedback-box { text-align: center; padding: 20px 0; }
  .feedback-title { font-family: 'Merriweather', serif; font-size: 26px; color: var(--accent-glow); margin-bottom: 12px; font-weight: 400; }
  .feedback-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; font-weight: 500; }
  
  .feedback-result-textarea { 
    width: 100%; 
    max-width: 500px; 
    height: 300px; 
    min-height: 300px; 
    margin: 16px auto 8px auto; 
    background: var(--glass-bg); 
    border: 1px solid var(--border-soft); 
    color: var(--text-main); 
    font-family: inherit; 
    font-size: 14px; 
    padding: 16px; 
    border-radius: 8px; 
    line-height: 1.6; 
    resize: none; 
    display: block; 
    overflow-y: auto;
  }

  .feedback-copy-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: flex-end; 
  }

  .feedback-copy-wrapper button {
    padding: 8px 14px;
    font-size: 11px;
    border-color: var(--accent-glow);
    background: transparent;
    cursor: pointer;
  }
  
  .resultBox { margin-top: 28px; display: none; border-top: 1px solid var(--border-soft); padding-top: 24px; }
  table { width: 100%; border-collapse: collapse; margin-top: 12px; }
  th, td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: 14px; transition: border-color 1.1s ease; }
  th { font-family: 'Merriweather', serif; font-size: 18px; color: var(--text-muted); font-weight: 700; }
  .schema-descriptions { margin-top: 24px; padding: 16px; background: var(--glass-bg); border-radius: 6px; font-size: 14px; line-height: 1.6; color: var(--text-muted); border: 1px solid var(--border-soft); font-weight: 500; transition: background 1.1s ease; }

  .contract-text { font-size: 14px; line-height: 1.7; color: var(--text-muted); text-align: left; transition: color 1.1s ease; }
  .contract-text h3 { font-family: 'Merriweather', serif; font-size: 20px; color: var(--accent-glow); margin: 24px 0 10px 0; font-weight: 700; transition: color 1.1s ease; }
  .contract-text ul { padding-left: 18px; margin: 8px 0; }
  .contract-text li { margin-bottom: 6px; }

  .price-tag { font-family: 'Merriweather', serif; font-size: 24px; color: var(--accent-glow); margin-bottom: 20px; transition: color 1.1s ease; }

  .messenger-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 24px; }
  .messenger-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; background: var(--glass-bg); border: 1px solid var(--border-soft); border-radius: 8px; color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.3s ease; }
  .messenger-btn:hover { background: var(--hover-bg); border-color: var(--accent-amber); color: var(--accent-glow); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
  .messenger-icon { width: 22px; height: 22px; fill: currentColor; }

  .diploma-section { margin-top: 40px; border-top: 1px solid var(--border-soft); padding-top: 30px; width: 100%; }
  .diploma-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; width: 100%; }
  .diploma-img { 
    width: 100%; 
    aspect-ratio: 1.414;
    object-fit: cover; 
    border: 1px solid var(--border-soft); 
    border-radius: 6px; 
    cursor: zoom-in; 
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--glass-bg);
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
  }
  .diploma-img:hover { 
    transform: translateY(-4px); 
    border-color: var(--accent-glow); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); 
  }

  .lightbox-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); z-index: 1000; 
    display: none; align-items: center; justify-content: center; 
    opacity: 0; transition: opacity 0.3s ease; padding: 20px; 
    backdrop-filter: blur(5px); cursor: zoom-out; 
  }
  .lightbox-overlay.active { display: flex; opacity: 1; }
  .lightbox-img { 
    max-width: 100%; max-height: 100%; object-fit: contain; 
    border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    transform: scale(0.95); transition: transform 0.3s ease; cursor: default; 
  }
  .lightbox-overlay.active .lightbox-img { transform: scale(1); }

  .breathe-widget { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0; min-height: 320px; position: relative; }
  .breathe-circle { width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--accent-amber) 0%, transparent 70%); box-shadow: 0 0 40px rgba(0,0,0,0.05); border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; position: relative; transition: transform 4s linear, opacity 4s linear, box-shadow 4s linear, background 1.1s ease, border-color 1.1s ease; opacity: 0.6; }
  .breathe-text { font-family: 'Merriweather', serif; font-size: 22px; color: var(--accent-glow); font-weight: 700; position: absolute; text-align: center; z-index: 10; transition: opacity 0.5s ease, color 1.1s ease; }
  .breathe-counter { margin-top: 40px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }
  
  .phase-inhale { transform: scale(1.8); opacity: 1; box-shadow: 0 0 60px var(--border-soft); }
  .phase-hold1 { transform: scale(1.8); opacity: 0.8; box-shadow: 0 0 40px var(--border-soft); }
  .phase-exhale { transform: scale(1); opacity: 0.5; box-shadow: 0 0 20px rgba(0,0,0,0.02); }
  .phase-hold2 { transform: scale(1); opacity: 0.4; box-shadow: 0 0 10px rgba(0,0,0,0.01); }

  .pmr-timer-text { font-size: 56px; font-weight: 300; font-family: 'Montserrat', sans-serif; margin: 20px 0; color: var(--accent-glow); transition: color 0.3s ease; }

  .global-footer-card {
    margin-top: auto; 
    text-align: center; 
    max-width: 800px; 
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .slider-group { margin-bottom: 20px; text-align: left; }
  .slider-group label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; line-height: 1.4; }
  .slider-value { color: var(--accent-glow); }
  input[type="range"] {
    -webkit-appearance: none; width: 100%; height: 6px; background: var(--glass-bg);
    border-radius: 4px; outline: none; border: 1px solid var(--border-soft); margin-top: 6px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent-glow); cursor: pointer; transition: transform 0.2s;
  }
  input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }



  .privacy-note {
    margin: 0 0 22px 0;
    padding: 18px 20px;
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent-amber);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.65;
    font-weight: 500;
  }

  .privacy-note strong { color: var(--text-main); }

  .result-actions {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
  }

  .status-line {
    min-height: 22px;
    margin-top: 8px;
    color: var(--accent-glow);
    font-size: 13px;
    font-weight: 600;
  }

  .history-panel {
    width: min(100%, 1040px);
    max-width: 1040px;
    margin: 22px auto 10px auto;
    text-align: left;
  }

  .history-panel-empty {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    padding: 8px 0 4px;
  }

  .history-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 18px 0 14px;
  }

  .history-filter-btn {
    padding: 8px 12px;
    border-color: var(--border-soft);
    color: var(--text-muted);
    font-size: 12px;
  }

  .history-filter-btn.active {
    background: var(--accent-amber);
    color: var(--bg-color);
    border-color: var(--accent-amber);
  }

  .history-list {
    display: grid;
    gap: 14px;
    margin-top: 12px;
  }

  .history-item {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--glass-bg);
    padding: 16px;
    overflow: hidden;
  }

  .history-item-main {
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(220px, 1.6fr) minmax(90px, 0.5fr) minmax(130px, 0.8fr) auto;
    gap: 14px;
    align-items: center;
  }

  .history-meta-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .history-meta-value {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
  }

  .history-details {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
  }

  .history-item.open .history-details { display: block; }

  .scale-bars {
    display: grid;
    gap: 10px;
  }

  .scale-bar-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) 70px minmax(110px, 0.8fr) minmax(160px, 1fr);
    gap: 12px;
    align-items: center;
  }

  .scale-bar-name {
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
  }

  .scale-bar-score, .scale-bar-level {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
  }

  .scale-bar-track {
    height: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--glass-bg);
    overflow: hidden;
  }

  .scale-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-amber), var(--accent-glow));
    border-radius: 999px;
  }

  .privacy-details {
    margin-top: 22px;
    text-align: left;
    border-top: 1px solid var(--border-soft);
    padding-top: 18px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
  }

  .privacy-details summary {
    cursor: pointer;
    color: var(--accent-glow);
    font-weight: 700;
    margin-bottom: 10px;
  }

  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--glass-bg); border-radius: 999px; }
  ::-webkit-scrollbar-thumb { background: var(--accent-amber); border-radius: 999px; border: 2px solid var(--bg-color); }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent-glow); }



  .test-group-grid { display: grid; gap: 16px; margin-top: 22px; }
  .test-group-card { padding: 0; overflow: hidden; }
  .test-group-card summary { list-style: none; cursor: pointer; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
  .test-group-card summary::-webkit-details-marker { display: none; }
  .test-group-title { font-family: 'Merriweather', serif; color: var(--accent-glow); font-size: 20px; line-height: 1.25; margin-bottom: 6px; }
  .test-group-sub { color: var(--text-muted); font-size: 13px; line-height: 1.55; font-weight: 500; }
  .test-group-chevron { color: var(--accent-glow); font-size: 18px; transform: rotate(0deg); transition: transform 0.25s ease; }
  .test-group-card[open] .test-group-chevron { transform: rotate(90deg); }
  .test-group-content { padding: 0 24px 24px; display: grid; gap: 12px; }
  .test-mini-card { border: 1px solid var(--border-soft); border-radius: 9px; background: var(--glass-bg); padding: 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
  .test-mini-card:hover { border-color: var(--accent-amber); background: var(--hover-bg); }
  .test-mini-title { color: var(--accent-glow); font-weight: 700; font-size: 15px; line-height: 1.35; margin-bottom: 5px; }
  .test-mini-desc { color: var(--text-muted); font-size: 13px; line-height: 1.45; font-weight: 500; }
  .test-mini-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .test-mini-pill { border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px 8px; color: var(--text-muted); font-size: 11px; font-weight: 700; }

  .history-panel { width: min(calc(100vw - 48px), 1040px); max-width: 1040px; position: relative; left: 50%; transform: translateX(-50%); }
  .history-item-main { grid-template-columns: minmax(105px, 0.65fr) minmax(210px, 1.6fr) minmax(80px, 0.45fr) minmax(120px, 0.8fr) minmax(210px, auto); }
  .history-item-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
  .history-item-actions button { padding: 9px 12px; font-size: 12px; }
  .history-delete-btn { min-width: 38px; border-color: rgba(230, 57, 70, 0.35); color: #d66; font-size: 18px !important; line-height: 1; padding: 8px 11px !important; }
  .history-delete-btn:hover:not(:disabled) { background: #d66; color: var(--bg-color); border-color: #d66; }
  .pdf-note { color: var(--text-muted); font-size: 12px; line-height: 1.5; margin-top: 10px; }

  @media(max-width: 768px) {
    .nav { padding: 14px 20px; flex-direction: column; gap: 14px; text-align: center; }
    .nav-links { justify-content: center; gap: 16px; }
    .theme-switcher { margin-top: 4px; }
    .action-grid { flex-direction: column; gap: 10px; width: 100%; padding: 0 10px; }
    .action-card-btn { width: 100%; min-height: 58px; }
    .hero-title { font-size: 34px; }
    .scale-item label { max-width: 36px; height: 36px; font-size: 13px; }
    .controls button { width: 100%; }
    .back-btn { width: 100%; justify-content: center; }
    .history-panel { width: 100%; left: auto; transform: none; }
    .test-mini-card { grid-template-columns: 1fr; }
    .test-group-card summary { align-items: flex-start; }
    .history-item-main { grid-template-columns: 1fr; gap: 10px; }
    .history-item-actions { justify-content: flex-start; }
    .scale-bar-row { grid-template-columns: 1fr; gap: 6px; }
    .scale-bar-track { width: 100%; }
  }

.diary-catalog-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.diary-card-active { width: 100%; max-width: 780px; margin-left: auto; margin-right: auto; }
.diary-fields { display: grid; gap: 14px; }
.diary-field { margin: 0; }
.diary-select {
  width: 100%; background: var(--glass-bg); border: 1px solid var(--border-soft);
  padding: 12px 14px; border-radius: 6px; color: var(--text-main); font-size: 14px;
  outline: none; transition: border-color .2s, color 1.1s ease, background 1.1s ease; font-family: inherit;
}
.diary-select:focus { border-color: var(--accent-amber); }
.record-notes { margin-top: 16px; display: grid; gap: 10px; }
.record-note-row { padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--glass-bg); }
.record-note-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 6px; }
.record-note-text { font-size: 14px; color: var(--text-main); line-height: 1.55; white-space: pre-wrap; }
.history-view-section { margin: 16px 0 18px 0; }
.history-view-section .charts-section { margin-top: 0; display: grid; gap: 12px; }
.history-view-section .charts-section h2 { font-family: 'Merriweather', serif; color: var(--accent-glow); font-size: 20px; margin: 4px 0 2px; }
.history-view-section .chart-card { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--glass-bg); padding: 14px; }
.history-view-section .chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.history-view-section .chart-head strong { color: var(--text-main); font-size: 14px; }
.history-view-section .chart-head span { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.history-view-section .mini-chart { width: 100%; height: 140px; display: block; background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 8px; }
.history-view-section .axis { stroke: var(--border-soft); stroke-width: 1.2; }
.history-view-section .grid { stroke: var(--border-soft); stroke-width: .8; stroke-dasharray: 4 4; opacity: .8; }
.history-view-section .trend-line { fill: none; stroke: var(--accent-glow); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.history-view-section .trend-dot { fill: var(--accent-glow); stroke: var(--card-bg); stroke-width: 1.5; }
.history-view-section .axis-label,
.history-view-section .date-label,
.history-view-section .score-label,
.history-view-section .chart-range { fill: var(--text-muted); font-size: 9px; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.history-view-section .score-label { fill: var(--text-main); }
.history-view-section .chart-empty { padding: 16px; border: 1px dashed var(--border-soft); border-radius: 8px; color: var(--text-muted); font-size: 13px; background: var(--glass-bg); }

@media(max-width: 768px) {
  .history-view-section .mini-chart { height: 120px; }
  .history-view-section .chart-head { flex-direction: column; gap: 4px; }
}

.history-block-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.history-block {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--glass-bg);
  overflow: hidden;
}

.history-block-summary {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 28px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
}

.history-block-summary:hover {
  background: var(--hover-bg);
}

.history-block-title {
  color: var(--accent-glow);
  font-family: 'Merriweather', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.history-block-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.45;
}

.history-block-chevron {
  color: var(--accent-amber);
  font-size: 24px;
  transform: rotate(0deg);
  transition: transform .2s ease;
  justify-self: end;
}

.history-block.open .history-block-chevron {
  transform: rotate(90deg);
}

.history-block-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border-soft);
}

.history-block.open .history-block-body {
  display: block;
}

.history-block-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 14px 0 12px;
}

.history-chart-drawer {
  display: none;
}

.history-chart-drawer.open {
  display: block;
}

.history-record-list {
  display: grid;
  gap: 8px;
}

.history-record {
  border: 1px solid rgba(184, 122, 53, .18);
  border-radius: 8px;
  background: rgba(0, 0, 0, .08);
  overflow: hidden;
}

.history-record-main {
  display: grid;
  grid-template-columns: minmax(90px, .55fr) minmax(220px, 1.5fr) minmax(60px, .35fr) minmax(170px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.history-record-date,
.history-record-score {
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
}

.history-record-title {
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
}

.history-record-level {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
}

.history-record .history-details {
  padding: 14px;
  margin-top: 0;
  border-top: 1px solid var(--border-soft);
}

.history-record.open .history-details {
  display: block;
}

.history-record .history-item-actions {
  min-width: 188px;
}

@media(max-width: 768px) {
  .history-block-summary {
    grid-template-columns: 1fr 24px;
  }
  .history-block-meta {
    grid-column: 1 / -1;
    order: 3;
  }
  .history-block-chevron {
    grid-column: 2;
    grid-row: 1;
  }
  .history-record-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .history-record .history-item-actions {
    min-width: 0;
    justify-content: flex-start;
  }
  .history-block-tools {
    justify-content: flex-start;
  }
}


.footer-contact-note {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.diploma-grid-expanded {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.diploma-placeholder-card {
  min-height: 150px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  gap: 10px;
  box-shadow: inset 0 0 18px rgba(0,0,0,0.16);
}

.diploma-placeholder-icon {
  min-width: 62px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-glow);
  background: rgba(0,0,0,0.14);
}

.diploma-placeholder-title {
  font-family: 'Merriweather', serif;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text-main);
  font-weight: 700;
}

.diploma-placeholder-status {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

@media (max-width: 860px) {
  .diploma-grid-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .diploma-grid-expanded { grid-template-columns: 1fr; }
}
