/* Claws design tokens — shared across all prototype screens. */
/* Mirrors docs/DESIGN.md v0.2.                                  */

:root {
  /* Color — primary */
  --navy:        #0F2540;
  --navy-deep:   #08182B;
  --navy-subtle: #2A3F5C;

  /* Color — neutrals */
  --white:    #FFFFFF;
  --ivory:    #FAF8F4;
  --bone:     #F1ECE3;
  --stone:    #E2DBCE;
  --stone-md: #C5BBA8;
  --slate:    #6B6E73;
  --charcoal: #2B2C30;
  --obsidian: #14151A;

  /* Color — accents */
  --tiffany:      #0ABAB5;
  --tiffany-soft: #E0F5F3;
  --tiffany-deep: #07807C;
  --brass:        #B89968;
  --brass-soft:   #EEE3CB;

  /* Color — semantic */
  --sage:  #5E8061;
  --amber: #C58A2E;
  --brick: #A03B2C;
  --steel: #4A6177;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(15,37,64,0.05);
  --shadow-2: 0 4px 12px rgba(15,37,64,0.08);

  /* Radius */
  --r-sm:  6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Font stacks */
  --font-serif: 'Fraunces', 'New York', 'Times New Roman', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Noto Sans JP', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', SFMono-Regular, Menlo, monospace;
}

/* Reset for iframe screens */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
}
body { overflow: hidden; }

/* Type scale */
.h-display-md { font-family: var(--font-serif); font-weight: 600; font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.h-display-lg { font-family: var(--font-serif); font-weight: 600; font-size: 32px; line-height: 40px; letter-spacing: -0.015em; }
.h-heading-lg { font-weight: 600; font-size: 20px; line-height: 28px; letter-spacing: -0.005em; }
.h-heading-md { font-weight: 600; font-size: 17px; line-height: 24px; }
.h-heading-sm { font-weight: 600; font-size: 15px; line-height: 22px; }
.t-body-lg    { font-size: 17px; line-height: 26px; }
.t-body-md    { font-size: 15px; line-height: 22px; }
.t-body-sm    { font-size: 13px; line-height: 20px; color: var(--slate); }
.t-label      { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.t-caption    { font-size: 11px; line-height: 14px; font-weight: 500; color: var(--slate); }
.t-mono-sm    { font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 500; }

/* iOS Status Bar (mock) */
.ios-status {
  height: 47px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 24px 8px;
  position: relative;
  flex-shrink: 0;
}
.ios-status::before {
  /* Dynamic island */
  content: '';
  position: absolute;
  top: 11px; left: 50%;
  transform: translateX(-50%);
  width: 124px; height: 36px;
  background: var(--obsidian);
  border-radius: 18px;
}
.ios-status .time { font-weight: 600; font-size: 15px; color: var(--charcoal); position: relative; z-index: 1; }
.ios-status .right { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--charcoal); position: relative; z-index: 1; }

/* iOS Top Nav */
.ios-nav {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: var(--ivory);
  flex-shrink: 0;
}
.ios-nav .title { font-weight: 600; font-size: 17px; }
.ios-nav .left, .ios-nav .right { display: flex; align-items: center; gap: 12px; min-width: 60px; color: var(--navy); }
.ios-nav .right { justify-content: flex-end; }
.ios-nav button { background: none; border: none; color: var(--navy); cursor: pointer; padding: 8px; }

/* iOS Tab Bar */
.ios-tab-bar {
  height: 83px;
  padding: 8px 0 34px;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--stone);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-shrink: 0;
}
.ios-tab-bar .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--slate);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  flex: 1;
}
.ios-tab-bar .tab.active { color: var(--navy); }
.ios-tab-bar .tab svg { width: 26px; height: 26px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  min-height: 48px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease-out;
}
.btn-primary {
  background: var(--navy);
  color: var(--ivory);
}
.btn-primary:hover { background: var(--navy-deep); }
.btn-accent {
  background: var(--tiffany);
  color: var(--navy);
}
.btn-accent:hover { background: var(--tiffany-deep); color: var(--ivory); }
.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--stone);
}
.btn-ghost:hover { border-color: var(--slate); }
.btn-text {
  background: transparent;
  color: var(--navy);
  min-height: auto;
  padding: 6px 10px;
}
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }

/* Cards */
.card {
  background: var(--bone);
  border: 1px solid var(--stone);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card-compact { padding: 16px; }
.card-flat { box-shadow: none; background: var(--white); }

/* AI Card — Claws signature */
.ai-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--brass);
  text-transform: uppercase;
}
.ai-marker::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tiffany);
  display: inline-block;
}

/* Verified lawyer badge */
.badge-verified {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 16px; height: 16px;
  background: var(--brass);
  border: 2px solid var(--ivory);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  font-size: 8px;
  font-weight: 700;
}

/* Privileged conversation header */
.privileged-header {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 16px;
  background: var(--stone);
  border-bottom: 1px solid var(--steel);
  font-size: 11px;
  color: var(--slate);
  font-weight: 500;
  flex-shrink: 0;
}
.privileged-header svg { width: 12px; height: 12px; stroke: var(--steel); }

/* Severity chips */
.sev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sev-critical, .sev-high { background: rgba(160,59,44,0.10); color: var(--brick); }
.sev-medium { background: rgba(197,138,46,0.12); color: var(--amber); }
.sev-low    { background: rgba(74,97,119,0.12); color: var(--steel); }
.sev-info   { background: var(--stone); color: var(--slate); }
.sev-chip svg { width: 11px; height: 11px; }

/* Chip / Tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--stone);
  color: var(--charcoal);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.chip-outline { background: transparent; border: 1px solid var(--stone-md); }
.chip-brass { background: var(--brass-soft); color: var(--brass); }
.chip-active { background: var(--navy); color: var(--ivory); }

/* Avatar */
.avatar {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--stone-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ivory);
  font-size: 22px;
  overflow: visible;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 40px; height: 40px; font-size: 16px; }
.avatar-lg { width: 80px; height: 80px; font-size: 30px; }

/* Disclaimer banner */
.disclaimer {
  background: var(--stone);
  color: var(--slate);
  font-size: 11px;
  line-height: 14px;
  padding: 8px 16px;
  text-align: center;
  flex-shrink: 0;
}

/* Content wrapper inside iframe */
.screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--ivory);
}
.screen-body {
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.screen-body.scrollable { overflow-y: auto; }

/* Inputs */
.input {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--stone);
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
  color: var(--charcoal);
  outline: none;
  transition: border-color 150ms;
}
.input:focus { border-color: var(--tiffany); box-shadow: 0 0 0 2px rgba(10,186,181,0.18); }
.input::placeholder { color: var(--slate); }

/* Section divider */
.divider { height: 1px; background: var(--stone); margin: 12px 0; }

/* Utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.text-slate { color: var(--slate); }
.text-navy { color: var(--navy); }
.text-tiffany { color: var(--tiffany); }
.text-brass { color: var(--brass); }
.serif { font-family: var(--font-serif); }
.mono  { font-family: var(--font-mono); }

/* Dark theme override (engage via ?theme=dark on iframe src) */
body.theme-dark {
  --ivory: #08182B;
  --bone:  #14253D;
  --stone: #2A3F5C;
  --stone-md: #3A557A;
  --slate: #97A6BD;
  --charcoal: #ECEEF2;
  --white: #14253D;
  --navy: #FAF8F4;
  --navy-deep: #FFFFFF;
}
body.theme-dark .ios-tab-bar { background: rgba(8,24,43,0.92); border-top-color: var(--stone); }
body.theme-dark .btn-primary { background: var(--ivory); color: var(--obsidian); }
body.theme-dark .btn-primary:hover { background: var(--bone); }
