*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #080808;
  --surface:     #0f0f0f;
  --surface2:    #181818;
  --border:      #242424;
  --text:        #f5f2ed;
  --text-dim:    #6a6560;
  --text-dimmer: #595450;
  --accent:      #c9a84c;
  --accent-dim:  #8a6e2f;
  --user-bg:     #131313;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* ── MARK ── */
.v-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── SHARED ── */

.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 20px;
  overflow-y: auto;
}
.screen.active { display: flex; }

.screen-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.screen-body {
  max-width: 400px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}

.btn-primary {
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  padding: 11px 28px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dim); color: var(--text); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-ghost.danger:hover { color: #e05555; border-color: #e05555; }

.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── CHAT SHARED ── */

#onboard-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
}

.logo-sub {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 400;
}

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

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message-group {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.message-group:last-child { border-bottom: none; }

.msg-virtus {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid #8a6e2f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
}

.msg-content {
  flex: 1;
  max-width: 720px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.85;
}

/* Proper paragraph spacing in messages */
.msg-content br + br {
  display: block;
  content: '';
  margin-top: 0.8em;
}

.msg-user {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.msg-user .msg-content {
  background: var(--user-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 16px;
  max-width: 75%;
  color: #8a8680;
  font-size: 15px;
  line-height: 1.65;
}

.typing {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 24px 0;
}

.typing-cursor {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 18px 28px 22px;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

textarea.msg-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  resize: none;
  min-height: 46px;
  max-height: 160px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: -0.01em;
}
textarea.msg-input:focus { border-color: var(--accent-dim); }
textarea.msg-input::placeholder { color: var(--text-dimmer); font-weight: 400; }

.send-btn {
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  padding: 11px 20px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  flex-shrink: 0;
  height: 46px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.send-btn:hover:not(:disabled) { background: var(--accent); color: #080808; border-color: var(--accent); }
.send-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.input-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.02em;
}

/* ── EMPTY STATE ── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  padding-bottom: 80px;
}

.empty-mark {
  width: 48px; height: 48px;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.empty-sub { font-size: 16px; color: var(--text-dim); letter-spacing: -0.01em; font-weight: 500; }

/* ── QUICK ACTIONS ── */

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  max-width: 440px;
}

.quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: left;
  letter-spacing: -0.01em;
}
.quick-btn:hover { border-color: var(--accent-dim); color: var(--text); background: var(--surface2); }

/* ── APP LAYOUT ── */

#app {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: row;
}
#app.active { display: flex; }

/* ── SIDEBAR ── */

#sidebar {
  width: 190px;
  flex-shrink: 0;
  background: #050505;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 16px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  gap: 12px;
  position: relative;
}

.nav-item:hover {
  background: var(--surface);
  border-left-color: var(--accent-dim);
}
.nav-item:hover .nav-label { color: var(--text-dim); }
.nav-item:hover .nav-svg   { color: var(--text-dim); }

.nav-item.active {
  background: var(--surface2);
  border-left-color: var(--accent);
}
.nav-item.active .nav-label {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.nav-item.active .nav-svg { color: var(--accent); }

.nav-label {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  font-weight: 600;
  transition: color 0.15s;
}

.nav-icon { display: none; }

.nav-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dimmer);
  transition: color 0.15s;
  width: 26px;
}
.nav-item:hover .nav-svg { color: var(--text-dim); }
.nav-item.active .nav-svg { color: var(--accent); }

/* ── MAIN CONTENT ── */

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── ROOMS ── */

.room {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.room.active { display: flex; }

/* ── PROFILE ROOM ── */

.profile-content, .habit-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  text-align: center;
  padding: 60px 40px;
}

.profile-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.profile-empty-desc {
  font-size: 13px;
  color: var(--text-dimmer);
  max-width: 320px;
  line-height: 1.7;
}

.empty-go-session {
  margin-top: 4px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.empty-go-session:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.profile-card, .habit-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  margin-bottom: 20px;
  background: var(--surface);
}

.profile-card-label, .habit-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 14px;
}

.profile-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.profile-section:nth-child(odd) {
  border-right: 1px solid var(--border);
}
.profile-section:nth-last-child(1),
.profile-section:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}

.profile-section-title {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.profile-section-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

.profile-section-body p { margin-bottom: 4px; }

.profile-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-edit-btn {
  background: none;
  border: none;
  color: var(--text-dimmer);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
  flex-shrink: 0;
}
.profile-edit-btn:hover { color: var(--accent); }

.profile-edit-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: none;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ── HABIT PLAN ROOM ── */

.habit-block {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.habit-block:first-of-type { padding-top: 0; }
.habit-block:last-of-type { border-bottom: none; padding-bottom: 0; }

.habit-block-title {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.habit-block-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.habit-block-body p { margin-bottom: 3px; }

.habit-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 20px 18px;
}

.habit-empty-actions .btn-primary {
  font-size: 10px;
  padding: 8px 18px;
}

.habit-empty-actions .btn-ghost {
  font-size: 10px;
  padding: 8px 14px;
}

.habit-closing {
  font-size: 13px;
  color: var(--text-dimmer);
  font-style: italic;
  margin-top: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--accent-dim);
}

.habit-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ── PANEL / OVERLAY ── */

.panel-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 100;
  backdrop-filter: blur(2px);
}
.panel-overlay.active { display: block; }

.slide-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 400px;
  background: #0f0f0f;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 28px 24px 48px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 101;
}
.slide-panel.active { transform: translateX(0); }
.slide-panel::-webkit-scrollbar { width: 4px; }
.slide-panel::-webkit-scrollbar-thumb { background: var(--border); }

.panel-close {
  position: absolute;
  top: 18px; right: 18px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 20px; cursor: pointer;
  padding: 4px 8px; line-height: 1;
  transition: color 0.15s;
}
.panel-close:hover { color: var(--text); }

.panel-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 24px;
}

.panel-section { margin-bottom: 22px; }
.panel-section h2 {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.panel-section p {
  font-size: 13px; color: var(--text-dim); line-height: 1.65;
}
.panel-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.help-commands { display: flex; flex-direction: column; gap: 10px; }
.help-command { display: flex; gap: 12px; align-items: flex-start; }
.help-command code {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 3px; padding: 3px 8px; font-size: 11px;
  color: var(--accent); font-family: 'SF Mono', 'Menlo', monospace;
  white-space: nowrap; flex-shrink: 0; margin-top: 1px;
}
.help-command span { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ── MOBILE ── */
/* Mobile End Session — shown in header, hidden in sidebar */
.mobile-end-session { display: none; }

@media (max-width: 600px) {
  #app.active { flex-direction: column-reverse; }

  #sidebar {
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Hide sidebar End Session footer on mobile */
  #sidebar > div:last-child { display: none; }

  /* Show mobile End Session in headers */
  .mobile-end-session {
    display: block;
    font-size: 10px;
    padding: 5px 10px;
    letter-spacing: 0.08em;
  }

  .sidebar-brand { display: none; }

  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    width: 100%;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    border-left: none;
    border-top: 2px solid transparent;
    min-width: 0;
  }
  .nav-item:hover { border-left-color: transparent; border-top-color: var(--accent-dim); }
  .nav-item.active { border-top-color: var(--accent); border-left-color: transparent; }

  .nav-icon { display: block; font-size: 18px; line-height: 1; }
  .nav-label { font-size: 9px; letter-spacing: 0.06em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-section-label { display: none; }

  .chat-header { padding: 12px 16px 10px; }
  .messages { padding: 0 16px; }
  .message-group { padding: 16px 0; }
  .msg-user .msg-content { max-width: 92%; }

  .input-area {
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  textarea.msg-input { font-size: 16px; padding: 10px 12px; min-height: 44px; }
  .input-hint { display: none; }

  .profile-content, .habit-content { padding: 20px 16px; }
  .record-content, .goals-content { padding: 20px 16px; }
}

/* ── CONFIRM FIELD ── */
.confirm-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
}
.confirm-field-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 4px;
  font-weight: 600;
}
.confirm-field-value {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}
.confirm-field.full { grid-column: 1 / -1; }

/* ── MY RECORD ── */
#room-record {
  overflow-y: auto;
}
#room-record .chat-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.record-content {
  overflow-y: visible;
  padding: 32px 40px 60px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.record-level-card {
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-level-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  font-weight: 600;
}

.record-level-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.record-level-dots {
  display: flex;
  gap: 8px;
  margin: 4px 0;
}

.level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s;
}
.level-dot.filled { background: var(--accent); }

.record-level-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.record-section {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.record-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.record-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.record-section-status {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dim);
}
.record-section-status.done { color: #6aaa7a; }

.record-empty {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-dim);
}

#profile-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
#habit-sections {
  padding: 16px 20px;
}

/* ── GOALS ── */
.goals-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.goal-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.goal-item:first-child { border-top: 1px solid var(--border); }

.goal-check {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.goal-check:hover { border-color: var(--accent-dim); }
.goal-check.done { background: var(--accent-dim); border-color: var(--accent-dim); }
.goal-check.done::after { content: '✓'; font-size: 10px; color: var(--text); }

.goal-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.goal-text.done { color: var(--text-dimmer); text-decoration: line-through; }

.goal-date {
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.goal-delete {
  background: none;
  border: none;
  color: var(--text-dimmer);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.goal-delete:hover { color: #e05555; }

/* ── COMMITMENTS ── */
.commitment-prompt {
  margin: 8px 0 0 54px;
  background: var(--surface2);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.commitment-prompt-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}
.commitment-prompt-text strong { color: var(--text); font-weight: 600; }

.commitment-prompt-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-save-commitment {
  background: var(--accent-dim);
  border: none;
  color: var(--bg);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-save-commitment:hover { background: var(--accent); }

.commitment-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.commitment-item:first-child { border-top: 1px solid var(--border); }

.commitment-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.commitment-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  font-weight: 500;
}

.commitment-status {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.commitment-status.active  { color: var(--accent); border-color: var(--accent-dim); }
.commitment-status.kept    { color: #7aaf7a; border-color: #2e4a2e; }
.commitment-status.broken  { color: #8b4040; border-color: #3a1515; }
.commitment-status.expired { color: var(--text-dimmer); border-color: var(--border); }

.commitment-meta {
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

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

.btn-kept {
  background: none; border: 1px solid #2e4a2e;
  color: #7aaf7a; padding: 5px 14px;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
  font-family: inherit; border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.btn-kept:hover { background: #2e4a2e; color: #a8d4a8; }

.btn-broke {
  background: none; border: 1px solid #3a1515;
  color: #8b4040; padding: 5px 14px;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
  font-family: inherit; border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.btn-broke:hover { background: #3a1515; color: #c07070; }

/* ── MOMENTS ── */
.moment-item {
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}
.moment-item:first-child { border-top: 1px solid var(--border); }

.moment-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  padding-left: 14px;
  border-left: 2px solid var(--accent-dim);
  margin-bottom: 8px;
  font-style: italic;
}

.moment-date {
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
  padding-left: 14px;
}

.moment-delete {
  background: none;
  border: none;
  color: var(--text-dimmer);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  transition: color 0.15s;
  margin-left: 10px;
}
.moment-delete:hover { color: #e05555; }

/* ── CONFIRM MODAL ── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.confirm-overlay.active { display: flex; }

.confirm-modal {
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
  max-width: 340px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-modal-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

.confirm-modal-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.confirm-modal-actions .btn-primary {
  flex: 1;
}

.confirm-modal-actions .btn-ghost {
  flex: 1;
}

/* ── IDLE WARNING MODAL ── */
.idle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.idle-overlay.active { display: flex; }

.idle-modal {
  background: #0f0f0f;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 40px 36px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.idle-countdown {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.idle-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

.idle-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 260px;
}

/* ── HABIT CHECK-IN ── */

.checkin-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.checkin-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkin-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--surface);
}

/* ── HABIT LOG ── */

.habit-log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.habit-log-entry:last-child { border-bottom: none; }

.habit-log-date { color: var(--text-dimmer); letter-spacing: 0.04em; }
.habit-log-days { color: var(--text-dim); font-weight: 600; letter-spacing: 0.06em; }

/* ── PRINT OVERLAY ── */

#print-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 500;
  overflow-y: auto;
  flex-direction: column;
}

#print-overlay-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 60px;
  width: 100%;
}

#print-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

#print-overlay-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #333;
}

#print-overlay-content {
  padding: 28px 24px;
  font-family: -apple-system, Arial, sans-serif;
  color: #111;
  line-height: 1.65;
}

/* Print content component styles */
.pt-week  { font-size: 12px; color: #555; margin-bottom: 16px; }
.pt-h2    { font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #555; margin-bottom: 5px; margin-top: 16px; }
.pt-section { margin-bottom: 16px; }
.pt-value { font-size: 14px; font-weight: 600; border-bottom: 1px solid #ccc; padding-bottom: 3px; min-height: 22px; color: #111; }
.pt-blank { border-bottom: 1px solid #aaa; min-height: 22px; }
.pt-intention { font-size: 13px; font-style: italic; border: 1px solid #ccc; padding: 10px 12px; border-radius: 3px; background: #fafafa; margin-top: 6px; }
.pt-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.pt-table td { text-align: center; padding: 0 3px; }
.pt-dl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #555; margin-bottom: 4px; }
.pt-tb { width: 34px; height: 34px; border: 2px solid #333; border-radius: 4px; margin: 0 auto; }
.pt-writeline { border-bottom: 1px solid #aaa; min-height: 28px; margin-top: 6px; }
.pt-bringback { border: 1px solid #ccc; border-radius: 4px; padding: 12px 14px; margin-top: 8px; background: #f9f9f9; }
.pt-bringback p { margin-bottom: 8px; font-size: 13px; }
.pt-bringback p:last-child { margin-bottom: 0; }
.pt-p { font-size: 14px; color: #222; }
.pt-rule { font-size: 14px; border-left: 3px solid #111; padding-left: 12px; margin-top: 8px; font-weight: 500; color: #111; }

@media print {
  /* When print overlay is open, print only its content */
  #print-overlay-bar { display: none !important; }
  #sidebar, .chat-header, #goal-form, #app, #onboard-screen, #profile-confirm-screen { display: none !important; }
  #print-overlay { display: block !important; position: static !important; background: #fff !important; }
  #print-overlay-inner { max-width: 100%; padding: 0; }
  #print-overlay-content { padding: 16px; }
}

  
/* ── RELEASE PLAN ── */

.release-plan-btn {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.release-plan-btn:hover {
  background: var(--accent-dim);
  color: var(--text);
}

/* Release plan document (inside print overlay) */
.rp-doc {
  font-family: -apple-system, Arial, sans-serif;
  color: #111;
  max-width: 520px;
  margin: 0 auto;
}
.rp-doc-header {
  border-bottom: 2px solid #111;
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.rp-doc-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111;
  margin-bottom: 4px;
}
.rp-doc-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.rp-doc-date {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}
.rp-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}
.rp-section:last-of-type {
  border-bottom: none;
}
.rp-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 10px;
}
.rp-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.rp-list li {
  font-size: 14px;
  color: #111;
  margin-bottom: 6px;
  line-height: 1.5;
}
.rp-footer {
  margin-top: 24px;
  font-size: 11px;
  color: #aaa;
  text-align: right;
}

/* ── CV DOCUMENT ── */
.cv-doc {
  font-family: -apple-system, Arial, sans-serif;
  color: #111;
  max-width: 520px;
  margin: 0 auto;
}
.cv-doc-header {
  border-bottom: 3px solid #111;
  padding-bottom: 12px;
  margin-bottom: 22px;
}
.cv-doc-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  margin-bottom: 4px;
}
.cv-doc-looking {
  font-size: 13px;
  color: #555;
}
.cv-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e8e8e8;
}
.cv-section:last-of-type {
  border-bottom: none;
}
.cv-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
}
.cv-para {
  font-size: 14px;
  color: #222;
  line-height: 1.6;
  margin: 0;
}
.cv-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.cv-list li {
  font-size: 14px;
  color: #222;
  margin-bottom: 5px;
  line-height: 1.5;
}
.cv-footer {
  margin-top: 20px;
  font-size: 11px;
  color: #bbb;
  text-align: right;
}

/* ── PORTFOLIO PRINT ── */
.pf-doc {
  font-family: -apple-system, Arial, sans-serif;
  color: #111;
  max-width: 560px;
  margin: 0 auto;
}
.pf-header {
  border-bottom: 3px solid #111;
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.pf-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111;
}
.pf-subtitle {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}
.pf-date {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}
.pf-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8e8e8;
}
.pf-section:last-of-type { border-bottom: none; }
.pf-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}
.pf-para {
  font-size: 14px;
  color: #222;
  line-height: 1.6;
  margin-bottom: 6px;
}
.pf-label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pf-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.pf-list li {
  font-size: 14px;
  color: #222;
  margin-bottom: 4px;
  line-height: 1.5;
}
.pf-footer {
  margin-top: 24px;
  font-size: 11px;
  color: #bbb;
  text-align: right;
}
