/* ==========================================================================
   Kalkuli - Scientific Calculator (Windows 11 Light Mode Design System)
   ========================================================================== */

/* 1. Design Tokens & Custom Properties */
:root {
  /* Windows 11 Light Theme Palette */
  --win-bg: #f3f3f3;
  --win-card-bg: #ffffff;
  --win-card-secondary: #f9f9f9;
  --win-border: rgba(0, 0, 0, 0.08);
  --win-border-strong: rgba(0, 0, 0, 0.14);

  /* Typography Colors */
  --text-primary: #1b1b1b;
  --text-secondary: #5d5d5d;
  --text-tertiary: #8a8a8a;

  /* Windows 11 Accent Color */
  --win-accent: #0067c0;
  --win-accent-hover: #005a9e;
  --win-accent-active: #004e8c;
  --win-accent-light: rgba(0, 103, 192, 0.08);

  /* Calculator Key Colors */
  --btn-num-bg: #ffffff;
  --btn-num-hover: #f6f6f6;
  --btn-num-active: #e9e9e9;
  --btn-num-border: rgba(0, 0, 0, 0.08);

  --btn-func-bg: #f9f9f9;
  --btn-func-hover: #f0f0f0;
  --btn-func-active: #e5e5e5;
  --btn-func-text: #262626;

  --btn-op-bg: #f3f3f3;
  --btn-op-hover: #e9e9e9;

  --btn-danger-bg: #fdf2f2;
  --btn-danger-text: #c53030;

  /* Fonts */
  --font-win: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  --font-mono: 'Consolas', 'Segoe UI Mono', 'Courier New', monospace;

  /* Corner Radius & Shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 2. Global Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--win-bg);
  color: var(--text-primary);
  font-family: var(--font-win);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--win-bg);
}

/* Accessible Visually Hidden Utility for SEO H1 */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Anti-Spam Honeypot Field Styling */
.hp-field {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 0 !important;
  height: 0 !important;
}

/* 3. Windows 11 Style Header Bar */
.win-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--win-border);
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-subtitle {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--win-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-nav,
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--win-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.win-nav::-webkit-scrollbar,
.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-win);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.nav-link.active {
  background: #ffffff;
  color: var(--win-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.win-btn-icon {
  background: #ffffff;
  border: 1px solid var(--win-border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-btn);
}

.win-btn-icon:hover {
  background: var(--btn-num-hover);
  color: var(--win-accent);
  border-color: var(--win-border-strong);
}

.history-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--win-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
}

/* 4. Main App Layout & View Transitions */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.app-view {
  display: none;
}

.app-view.active-view {
  display: block;
}

/* 5. CALCULATOR VIEW */
.calculator-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .calculator-wrapper.has-history {
    grid-template-columns: 1fr 280px;
    max-width: 980px;
  }
}

.calculator-window {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

/* Sub-header Bar */
.calc-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.mode-toggles {
  display: flex;
  gap: 0.4rem;
}

.win-pill {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.win-pill.active {
  background: var(--win-accent-light);
  color: var(--win-accent);
  border-color: rgba(0, 103, 192, 0.3);
}

.memory-active {
  color: var(--win-accent);
  border-color: var(--win-accent);
}

.memory-active.hidden {
  display: none;
}

.calc-type-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* Display Screen */
.calc-display-panel {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  text-align: right;
  position: relative;
}

.calc-history-line {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 1.3rem;
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 0.2rem;
}

.calc-primary-display {
  font-family: var(--font-win);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.copy-display-btn {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--win-border);
  color: var(--text-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.copy-display-btn:hover {
  background: var(--btn-num-hover);
  color: var(--text-primary);
}

.copy-tooltip {
  position: absolute;
  left: 2rem;
  background: var(--text-primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.copy-tooltip.show {
  opacity: 1;
}

/* Memory Bar */
.memory-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.btn-mem {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-win);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-mem:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Keypad Grid */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

.btn {
  background: var(--btn-func-bg);
  border: 1px solid var(--win-border);
  color: var(--btn-func-text);
  padding: 0.75rem 0.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-win);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s ease, border-color 0.1s ease, transform 0.05s ease;
  box-shadow: var(--shadow-btn);
}

.btn:hover {
  background: var(--btn-func-hover);
  border-color: var(--win-border-strong);
}

.btn:active,
.btn.btn-pressed {
  background: var(--btn-func-active);
  transform: scale(0.98);
}

/* Button Colors */
.btn-num {
  background: var(--btn-num-bg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

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

.btn-op {
  background: var(--btn-op-bg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.15rem;
}

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

.btn-symbol {
  background: var(--win-card-secondary);
  color: var(--text-primary);
  font-weight: 500;
}

.btn-const {
  background: var(--win-card-secondary);
  color: var(--win-accent);
  font-style: italic;
  font-family: serif;
}

.btn-clear {
  background: var(--win-card-secondary);
  color: #c53030;
  font-weight: 600;
}

.btn-clear:hover {
  background: var(--btn-danger-bg);
}

.btn-del {
  background: var(--win-card-secondary);
  color: var(--text-primary);
}

.btn-equals {
  background: var(--win-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.25rem;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 103, 192, 0.3);
}

.btn-equals:hover {
  background: var(--win-accent-hover);
}

.btn-equals:active {
  background: var(--win-accent-active);
}

.span-2 {
  grid-column: span 2;
}

/* History Side Panel */
.history-panel {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  max-height: 480px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--win-border);
  margin-bottom: 0.5rem;
}

.history-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.win-btn-text {
  background: transparent;
  border: none;
  color: var(--win-accent);
  font-size: 0.75rem;
  cursor: pointer;
}

.win-btn-text:hover {
  text-decoration: underline;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: right;
  transition: background 0.15s ease;
}

.history-item:hover {
  background: #e9e9e9;
}

.history-expr {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.history-val {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--win-accent);
}

.history-empty {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  text-align: center;
  margin: auto 0;
}


/* ==========================================================================
   6. SUBSTANTIAL PUBLISHER CONTENT & OPERATIONAL GUIDE
   ========================================================================== */
.publisher-content-card {
  max-width: 860px;
  margin: 1.5rem auto 3rem auto;
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.content-header {
  border-bottom: 1px solid var(--win-border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.content-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.lead-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.guide-grid-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.info-box {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.info-box-header {
  margin-bottom: 0.75rem;
}

.info-box h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.styled-list,
.styled-numbered-list {
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 0.5rem;
}

.styled-list li,
.styled-numbered-list li {
  margin-bottom: 0.35rem;
}

/* Worked Mathematical Examples */
.worked-examples-section {
  border-top: 1px solid var(--win-border);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.worked-examples-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.section-intro {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.example-card {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.example-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.formula-code {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  background: #ffffff;
  border: 1px solid var(--win-border-strong);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--win-accent);
  display: inline-block;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.example-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.keystroke-box {
  background: #ffffff;
  border: 1px solid var(--win-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.keystroke-box code {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
}

.result-tag {
  font-weight: 600;
  color: #16794c;
}

/* Precision Section */
.precision-section {
  border-top: 1px solid var(--win-border);
  padding-top: 1.5rem;
}

.precision-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.precision-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   7. EDUCATIONAL GUIDES, HANDBOOKS & FORMULAS
   ========================================================================== */
.guide-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

.guide-topic {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.topic-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.guide-topic p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.math-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.math-card {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}

.math-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.formula-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--win-accent);
  font-weight: 600;
  margin-bottom: 0.5rem !important;
}

.math-card p {
  font-size: 0.825rem;
  margin-bottom: 0;
}

.callout-box {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.15rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.math-table-container {
  overflow-x: auto;
  border: 1px solid var(--win-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.math-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.math-table th {
  background: var(--win-card-secondary);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--win-border-strong);
}

.math-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--win-border);
  color: var(--text-secondary);
  line-height: 1.5;
}

.math-table tr:last-child td {
  border-bottom: none;
}

.topic-note {
  font-size: 0.825rem !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 0 !important;
}

/* Formula Sheet */
.formula-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

.formula-group {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.formula-group h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--win-border);
  padding-bottom: 0.5rem;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.formula-card {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.825rem;
  line-height: 1.6;
}

.formula-card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}

.formula-card code {
  font-family: var(--font-mono);
  color: var(--win-accent);
  font-weight: 500;
}

/* Physical Constants Catalog */
.constants-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.constant-detail-card {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.const-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.const-symbol-badge {
  width: 44px;
  height: 44px;
  background: var(--win-card-secondary);
  color: var(--text-primary);
  border: 1px solid var(--win-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.const-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.const-val-str {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--win-accent);
  font-weight: 600;
}

.constant-detail-card p {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.faq-item {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.faq-answer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Legal Cards (About, Privacy, Terms) */
.legal-card {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
  margin-top: 1rem;
}

.legal-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-card h3:first-child {
  margin-top: 0;
}

.legal-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.legal-card a {
  color: var(--win-accent);
  text-decoration: underline;
}

/* 6. CONTACT PAGE */
.win-page-container {
  max-width: 820px;
  margin: 0 auto;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.page-title-box h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1.6fr 1fr;
  }
}

.win-form-card {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.win-form-group {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.win-form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.required {
  color: #c53030;
}

.win-form-group input,
.win-form-group textarea {
  background: #ffffff;
  border: 1px solid var(--win-border-strong);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-win);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.win-form-group input:focus,
.win-form-group textarea:focus {
  border-color: var(--win-accent);
  box-shadow: 0 0 0 2px var(--win-accent-light);
}

.win-form-group input.invalid,
.win-form-group textarea.invalid {
  border-color: #c53030;
}

.error-msg {
  color: #c53030;
  font-size: 0.75rem;
  display: none;
}

.error-msg.show {
  display: block;
}

.win-primary-btn {
  background: var(--win-accent);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-win);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 0.25rem;
}

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

.win-info-sidebar {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.win-info-sidebar h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.win-info-item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.win-info-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--win-accent-light);
  color: var(--win-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Disclaimer Styling */
.win-disclaimer-card {
  border-top: 1px solid var(--win-border);
  padding-top: 0.85rem;
  margin-top: 0.25rem;
}

.win-disclaimer-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.win-disclaimer-card p {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}

code {
  background: var(--win-card-secondary);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--win-border-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* 7. MODALS & TOASTS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.win-modal-card {
  background: var(--win-card-bg);
  border: 1px solid var(--win-border-strong);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  padding: 1.25rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--win-border);
  margin-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.constants-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
}

.constant-item-btn {
  background: var(--win-card-secondary);
  border: 1px solid var(--win-border);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.constant-item-btn:hover {
  background: #e9e9e9;
}

.const-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.const-units {
  font-size: 0.75rem;
  color: var(--win-accent);
  font-family: var(--font-mono);
}

.const-insert-tag {
  font-size: 0.75rem;
  color: var(--win-accent);
  font-weight: 600;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--text-primary);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 8. Windows 11 Enhanced Multi-Column Footer */
.win-footer {
  border-top: 1px solid var(--win-border);
  background: #ffffff;
  padding: 2.5rem 0 1.5rem 0;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.logo-icon-sm {
  width: 22px;
  height: 22px;
  background: var(--win-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 320px;
}

.footer-version {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.825rem;
  transition: color 0.15s ease;
}

.footer-nav-list a:hover {
  color: var(--win-accent);
}

.footer-bottom-bar {
  border-top: 1px solid var(--win-border);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-legal-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-legal-inline a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
}

.footer-legal-inline a:hover {
  color: var(--win-accent);
}

.footer-sep {
  color: var(--win-border-strong);
}

/* Responsive Rules */
@media (max-width: 900px) {
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .calc-keypad {
    gap: 0.25rem;
  }

  .btn {
    padding: 0.6rem 0.1rem;
    font-size: 0.85rem;
  }

  .calc-primary-display {
    font-size: 1.75rem;
  }

  .brand-subtitle {
    display: none;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .win-header {
    height: auto;
    padding: 0.4rem 0;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .win-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}