@font-face {
  font-family: 'NeueHaasDisplay';
  src: url('/fonts/NeueHaasDisplayMediu.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'InstrumentSerifCustom';
  src: url('/fonts/InstrumentSerif-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'InstrumentSerifCustom';
  src: url('/fonts/InstrumentSerif-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

:root {
  --bg-outer-1: #0a1451;
  --bg-outer-2: #0f1f71;
  --panel-main: #ececec;
  --panel-soft: #dedede;
  --panel-card: #cfcfcf;
  --ink: #101010;
  --ink-soft: #5d5d5d;
  --line: #a9a9a9;
  --chip: #6f6f6f;
  --accent: #5f95d8;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Roboto', 'Helvetica Neue', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 8%, rgba(72, 131, 235, 0.42), rgba(72, 131, 235, 0) 30%),
    linear-gradient(160deg, var(--bg-outer-1), var(--bg-outer-2));
}

button,
input,
textarea {
  font: inherit;
}

.app-frame {
  min-height: 100vh;
  padding: clamp(12px, 2vw, 24px);
}

.is-hidden {
  display: none !important;
}

.auth-view {
  min-height: calc(100vh - 48px);
  position: relative;
  display: grid;
  place-items: center;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(95, 176, 235, 0.2), rgba(47, 75, 255, 0.08)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 14px
    );
}

.auth-card-wrap {
  position: relative;
  width: min(560px, 92vw);
}

.auth-card {
  background: rgba(246, 248, 255, 0.94);
  border: 1px solid rgba(16, 25, 57, 0.2);
  border-radius: var(--radius-xl);
  padding: 34px clamp(20px, 3vw, 40px) 28px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.auth-kicker {
  margin: 0;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: #3a486a;
}

.auth-header h1 {
  margin: 8px 0 0;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: clamp(42px, 5vw, 52px);
}

.auth-subtitle {
  margin: 8px 0 0;
  color: #56627f;
  font-size: 21px;
  line-height: 1.35;
}

.auth-form {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.field-label {
  font-weight: 700;
  font-size: 30px;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
}

.pill-input {
  width: 100%;
  border: 1px solid rgba(14, 27, 58, 0.2);
  background: #fff;
  border-radius: var(--radius-pill);
  min-height: 58px;
  padding: 0 22px;
  font-size: 25px;
}

.pill-input:focus,
.scope-grid input:focus,
.chat-composer textarea:focus {
  outline: none;
  border-color: #2f4bff;
  box-shadow: 0 0 0 4px rgba(47, 75, 255, 0.14);
}

.confirm-row {
  display: grid;
  gap: 10px;
}

.pill-action {
  margin-top: 14px;
  min-height: 58px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #0a1122;
  color: #f7f9ff;
  font-size: 27px;
  font-weight: 700;
  cursor: pointer;
}

.swap-auth {
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
}

.swap-auth span {
  text-decoration: underline;
}

.auth-status {
  min-height: 24px;
  margin: 10px 0 0;
  color: #8a1638;
  font-size: 14px;
}

.workspace-view {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
}

.side-rail {
  border-radius: var(--radius-lg);
  background: var(--panel-main);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 14px;
}

.brand-orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(160deg, #3ba6f2, #7ec9dc);
}

.rail-divider {
  width: 56px;
  height: 1px;
  background: #a3a3a3;
}

.rail-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #d3d3d3;
  color: #111;
  cursor: pointer;
  font-size: 18px;
}

.rail-icon.is-active,
.rail-icon:hover {
  background: #0f0f0f;
  color: #fff;
}

.rail-signout {
  margin-top: auto;
}

.workspace-main {
  border-radius: var(--radius-xl);
  background: var(--panel-main);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
}

.workspace-title {
  margin: 0;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: clamp(36px, 3.3vw, 52px);
}

.workspace-title span {
  font-family: 'InstrumentSerifCustom', serif;
  font-style: normal;
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.ghost-button,
.dark-button {
  border-radius: var(--radius-pill);
  min-height: 34px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button {
  border: 0;
  background: #8b8b8b;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.dark-button {
  border: 0;
  background: #050505;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.scope-card {
  border-radius: var(--radius-md);
  background: #e4e4e4;
  padding: 10px 12px;
}

.scope-title-wrap h3 {
  margin: 0 0 8px;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: 15px;
}

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scope-grid label {
  display: grid;
  gap: 6px;
}

.scope-grid span {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.scope-grid input {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid #b8b8b8;
  padding: 0 10px;
  font-size: 13px;
  background: #f7f7f7;
}

.timeline-shell {
  border-radius: var(--radius-lg);
  background: #dfdfdf;
  padding: 10px 14px 14px;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.timeline-scroll {
  overflow: auto;
  padding-right: 6px;
}

.timeline-day {
  margin: 0 0 28px;
}

.timeline-day h4 {
  margin: 0 0 8px;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: 44px;
  letter-spacing: -0.02em;
}

.timeline-lane {
  position: relative;
  padding-left: 84px;
}

.timeline-lane::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--line);
}

.timeline-event {
  position: relative;
  margin: 0 0 20px;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: -56px;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4px solid #4b4b4b;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.event-card {
  background: var(--panel-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.event-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0e0e0e;
  color: #fff;
  font-size: 16px;
}

.event-type {
  background: #606060;
  border-radius: var(--radius-pill);
  color: #fff;
  padding: 5px 14px;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: 28px;
  line-height: 1;
  text-transform: capitalize;
}

.event-time {
  margin-left: auto;
  color: #505050;
  font-size: 21px;
}

.event-summary {
  margin: 14px 0 12px;
  font-family: 'NeueHaasDisplay', 'Roboto', sans-serif;
  font-size: 42px;
  line-height: 1.08;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip);
}

.event-chip {
  color: #fff;
  font-size: 23px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
}

.event-chip.tag {
  background: #608d72;
}

.event-chip.tag:nth-child(odd) {
  background: #89656d;
}

.event-empty {
  margin: 24px 0;
  color: var(--ink-soft);
  font-size: 20px;
}

.chat-messages {
  margin-top: 12px;
  max-height: 110px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14px;
}

.message.user {
  justify-self: end;
  background: #0f1a33;
  color: #f1f6ff;
}

.message.assistant {
  justify-self: start;
  background: #ffffff;
  border: 1px solid rgba(17, 28, 59, 0.15);
}

.chat-composer {
  margin-top: 16px;
  border-radius: 22px;
  border: 1px solid #bdbdbd;
  background: #d8d8d8;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.chat-composer textarea {
  width: 100%;
  resize: none;
  min-height: 34px;
  max-height: 92px;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #4a4a4a;
  padding: 3px 6px;
}

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

.chat-status {
  font-size: 12px;
  color: #5e5e5e;
  max-width: 170px;
  text-align: right;
}

@media (max-width: 1300px) {
  .timeline-day h4 {
    font-size: 34px;
  }

  .event-type {
    font-size: 22px;
  }

  .event-summary {
    font-size: 30px;
  }

  .event-chip {
    font-size: 17px;
  }
}

@media (max-width: 920px) {
  .workspace-view {
    grid-template-columns: 1fr;
  }

  .side-rail {
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 10px;
  }

  .rail-divider,
  .brand-orb {
    display: none;
  }

  .rail-signout {
    margin-top: 0;
    margin-left: auto;
  }

  .workspace-title {
    font-size: 32px;
  }

  .scope-grid {
    grid-template-columns: 1fr;
  }

  .timeline-day h4 {
    font-size: 28px;
  }

  .timeline-lane {
    padding-left: 54px;
  }

  .timeline-lane::before {
    left: 18px;
  }

  .timeline-event::before {
    left: -36px;
  }

  .event-type {
    font-size: 18px;
  }

  .event-summary {
    font-size: 22px;
  }

  .event-chip {
    font-size: 14px;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    justify-content: space-between;
  }
}
