/* TimeMachine UI polish — responsive foundations and focused components */
:root { --tm-violet: #6d42d8; --tm-ink: #171329; --tm-muted: #706b80; --tm-line: #ece8f4; }
html { scroll-behavior: smooth; }
body { min-width: 320px; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid rgb(124 92 230 / 42%); outline-offset: 3px; }
header nav { width: min(100%, 80rem); gap: 1rem; }
header nav > a { min-width: 0; }
header nav form { margin: 0; }
header nav button, header nav a { white-space: nowrap; }
main { min-width: 0; }
main section { min-width: 0; }
input, textarea, select { max-width: 100%; }

/* Password visibility control */
.password-field { position: relative; width: 100%; }
.password-field input { width: 100%; padding-right: 3.25rem !important; }
.password-toggle { position: absolute; inset-block: 0; right: .45rem; display: grid; width: 2.5rem; place-items: center; color: #777187; border-radius: .75rem; transition: color .18s ease, background .18s ease; }
.password-toggle:hover { color: var(--tm-violet); background: #f4f0ff; }
.password-toggle svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle:focus-visible { outline-offset: -2px; }

/* Living border around the writing surface */
.living-editor { position: relative; isolation: isolate; padding: 2px; border-radius: 1.15rem; background: conic-gradient(from var(--editor-angle, 0deg), #c4b5fd, #7c3aed, #ddd6fe, #a78bfa, #c4b5fd); box-shadow: 0 10px 35px rgb(91 55 170 / 7%); }
.living-editor::before { content: ""; position: absolute; z-index: -1; inset: -5px; border-radius: inherit; background: conic-gradient(from var(--editor-angle, 0deg), transparent 0 35%, rgb(139 92 246 / 42%) 48%, transparent 62% 100%); filter: blur(12px); opacity: .58; }
.living-editor__inner { overflow: hidden; border-radius: 1.05rem; background: white; }
.living-editor textarea { display: block; width: 100%; min-height: 18rem; max-height: 65vh; resize: vertical; border-radius: 1rem; background: #fff; line-height: 1.85; }
.living-editor:focus-within { box-shadow: 0 0 0 4px rgb(124 92 230 / 10%), 0 14px 40px rgb(91 55 170 / 12%); }
@media (prefers-reduced-motion: no-preference) {
  @property --editor-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
  .living-editor { animation: editor-border-turn 12s linear infinite; }
  @keyframes editor-border-turn { to { --editor-angle: 360deg; } }
}

/* Dashboard redesign */
.dashboard-page { min-height: 75vh; padding: clamp(1.5rem, 4vw, 3.75rem) clamp(1rem, 4vw, 2rem) 4rem; background: radial-gradient(ellipse at 88% 0%, #f0eaff 0, transparent 32rem), #faf9fc; }
.dashboard-shell { width: min(100%, 68rem); margin-inline: auto; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; }
.dashboard-heading h1 { margin-top: .55rem; color: var(--tm-ink); font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.08; overflow-wrap: anywhere; }
.eyebrow { color: #7452c7; font-size: .7rem; font-weight: 800; letter-spacing: .16em; line-height: 1.5; text-transform: uppercase; }
.dashboard-lead { max-width: 42rem; margin-top: .85rem; color: var(--tm-muted); font-size: .98rem; line-height: 1.75; }
.dashboard-primary-action, .feature-secondary, .timeline-empty a { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.9rem; padding: .75rem 1.1rem; border-radius: .9rem; background: #6840ce; color: white; font-size: .88rem; font-weight: 700; text-align: center; box-shadow: 0 8px 22px rgb(104 64 206 / 18%); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.dashboard-primary-action:hover, .feature-secondary:hover, .timeline-empty a:hover { transform: translateY(-2px); background: #5630b8; box-shadow: 0 12px 26px rgb(104 64 206 / 24%); }
.dashboard-notices { display: grid; gap: .5rem; margin-top: 1.5rem; }
.notice { padding: .85rem 1rem; border: 1px solid #e8defd; border-radius: .85rem; background: #f5f0ff; color: #5937a7; font-size: .88rem; }
.notice--error { border-color: #fecaca; background: #fff1f2; color: #b42336; }
.notice--success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 2rem; }
.stat-card { display: flex; min-width: 0; flex-direction: column; gap: .35rem; padding: 1.2rem 1.3rem; border: 1px solid #eeeaf5; border-radius: 1.1rem; background: rgb(255 255 255 / 88%); box-shadow: 0 5px 18px rgb(36 24 70 / 3%); }
.stat-label { color: #777187; font-size: .78rem; font-weight: 650; }
.stat-card strong { color: #251b3b; font-size: 2rem; font-weight: 760; letter-spacing: -.04em; line-height: 1.2; }
.stat-note { color: #9892a5; font-size: .72rem; }
.dashboard-feature { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; margin-top: 1.35rem; padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid #ded2fb; border-radius: 1.35rem; background: linear-gradient(120deg, #21143e, #39216b 62%, #53359a); color: white; box-shadow: 0 18px 40px rgb(52 31 94 / 13%); }
.dashboard-feature--today { background: linear-gradient(120deg, #183d36, #1d6251 65%, #27846c); border-color: #b7e2d5; }
.feature-mark { display: grid; width: 3.25rem; aspect-ratio: 1; place-items: center; border: 1px solid rgb(255 255 255 / 20%); border-radius: 1rem; background: rgb(255 255 255 / 10%); color: #e8ddff; font-size: 1.45rem; }
.feature-copy { min-width: 0; }
.dashboard-feature .eyebrow { color: #d3c3ff; }
.dashboard-feature--today .eyebrow { color: #b8eadb; }
.feature-copy h2 { margin-top: .35rem; font-size: clamp(1.35rem, 2.5vw, 1.8rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.2; }
.feature-copy p:not(.eyebrow) { max-width: 43rem; margin-top: .55rem; color: rgb(255 255 255 / 76%); font-size: .88rem; line-height: 1.7; }
.feature-secondary { white-space: nowrap; background: white; color: #4b2a91; box-shadow: none; }
.feature-secondary:hover { background: #f2edff; color: #3e207e; }
.feature-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.feature-actions a { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1rem; border-radius: .85rem; background: white; color: #155b49; font-size: .85rem; font-weight: 750; white-space: nowrap; }
.timeline-section { margin-top: 3rem; }
.timeline-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.timeline-heading h2 { margin-top: .3rem; color: var(--tm-ink); font-size: 1.65rem; font-weight: 750; letter-spacing: -.035em; }
.timeline-heading p:not(.eyebrow) { margin-top: .35rem; color: #817b8e; font-size: .86rem; line-height: 1.6; }
.timeline-count { padding: .45rem .75rem; border: 1px solid #e9e4f1; border-radius: 999px; background: white; color: #6f687e; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.timeline-list { position: relative; display: grid; gap: .8rem; padding-left: 1.35rem; }
.timeline-list::before { position: absolute; top: .9rem; bottom: .9rem; left: .38rem; width: 1px; background: #dcd3ef; content: ""; }
.timeline-item { position: relative; min-width: 0; }
.timeline-dot { position: absolute; top: 1.35rem; left: -1.35rem; width: .78rem; height: .78rem; border: 2px solid #8c6be0; border-radius: 50%; background: #faf9fc; box-shadow: 0 0 0 4px #f0eaff; }
.timeline-dot.is-today { border-color: #15956f; box-shadow: 0 0 0 4px #d9f4e9; }
.timeline-dot.is-past { border-color: #aaa4b5; box-shadow: 0 0 0 4px #eeedf0; }
.timeline-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; padding: 1.1rem 1.2rem; border: 1px solid #eeeaf4; border-radius: 1.05rem; background: white; box-shadow: 0 4px 14px rgb(38 27 62 / 3%); }
.timeline-card-main { min-width: 0; }
.timeline-date { color: #7452c7; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.timeline-card h3 { margin-top: .25rem; color: #2b2439; font-size: .95rem; font-weight: 750; }
.timeline-card p { margin-top: .25rem; color: #898394; font-size: .78rem; line-height: 1.5; }
.timeline-status { display: inline-flex; flex-shrink: 0; align-items: center; gap: .35rem; padding: .5rem .75rem; border-radius: 999px; font-size: .73rem; font-weight: 750; }
.status-sealed { background: #f1edfc; color: #6848b4; }
.status-today { background: #e6f7ef; color: #137653; }
.status-expired { background: #f1f0f3; color: #77717f; }
.timeline-empty { padding: 2.5rem 1.25rem; border: 1px dashed #d9d0e9; border-radius: 1.2rem; background: rgb(255 255 255 / 75%); text-align: center; }
.timeline-empty > div { color: #8b6cda; font-size: 2rem; }
.timeline-empty h3 { margin-top: .6rem; color: #302642; font-size: 1.1rem; font-weight: 750; }
.timeline-empty p { margin: .45rem auto 1rem; max-width: 28rem; color: #817b8e; font-size: .85rem; line-height: 1.6; }
.timeline-empty a { min-height: 2.5rem; font-size: .8rem; }
.dashboard-footnote { max-width: 52rem; margin: 1.6rem auto 0; color: #9892a2; font-size: .73rem; line-height: 1.65; text-align: center; }

@media (max-width: 760px) {
  header nav { padding-inline: 1rem !important; }
  header nav > a { gap: .55rem; }
  header nav > a span:last-child { font-size: .95rem; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .dashboard-primary-action { width: 100%; }
  .dashboard-feature { grid-template-columns: auto minmax(0, 1fr); }
  .feature-secondary, .feature-actions { grid-column: 1 / -1; justify-self: stretch; }
  .feature-secondary { white-space: normal; }
}
@media (max-width: 560px) {
  header nav { flex-wrap: wrap; row-gap: .7rem; }
  header nav > div { width: 100%; justify-content: flex-end; }
  header nav > div a, header nav > div button { padding-inline: .7rem !important; font-size: .78rem !important; }
  .dashboard-page { padding-inline: .9rem; }
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .stat-card { padding: .8rem .65rem; border-radius: .85rem; }
  .stat-label { min-height: 2.1em; font-size: .65rem; line-height: 1.35; }
  .stat-card strong { font-size: 1.55rem; }
  .stat-note { font-size: .61rem; line-height: 1.35; }
  .dashboard-feature { gap: .85rem; padding: 1.05rem; border-radius: 1.05rem; }
  .feature-mark { width: 2.6rem; border-radius: .8rem; }
  .timeline-heading { align-items: start; flex-direction: column; }
  .timeline-card { align-items: flex-start; flex-direction: column; padding: 1rem; }
  .timeline-status { align-self: flex-start; }
  .timeline-list { padding-left: 1.1rem; }
  .timeline-dot { left: -1.1rem; }
  .timeline-card h3 { overflow-wrap: anywhere; }
  .living-editor textarea { min-height: 15rem; font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* InfoAO UI/UX pass — responsive navigation, footer and content safety */
.tm-header { position:relative; z-index:30; border-bottom:1px solid #eee9f7; background:rgba(255,255,255,.92); backdrop-filter:blur(16px); }
.tm-nav { width:min(100%,80rem); min-height:4.6rem; margin-inline:auto; padding: .8rem clamp(1rem,3vw,2rem); display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.tm-brand { display:inline-flex; align-items:center; gap:.7rem; min-width:0; color:#211936; font-size:1.08rem; font-weight:800; letter-spacing:-.035em; }
.tm-brand > span:last-child { white-space:nowrap; }
.tm-brand > span:last-child span,.tm-footer-brand span { color:#7046d3; }
.tm-brand-mark { display:grid; width:2.55rem; aspect-ratio:1; place-items:center; flex:none; border-radius:.85rem; background:#7046d3; color:white; box-shadow:0 6px 16px #7046d32b; }
.tm-brand-mark svg { width:1.45rem; height:1.45rem; }
.tm-nav-actions { display:flex; align-items:center; justify-content:flex-end; gap:.55rem; min-width:0; }
.tm-nav-actions form { margin:0; }
.tm-nav-link,.tm-nav-home,.tm-nav-button,.tm-nav-cta { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-height:2.65rem; padding:.65rem .9rem; border-radius:.8rem; font-size:.84rem; font-weight:700; white-space:nowrap; }
.tm-nav-link,.tm-nav-home { color:#554b68; }
.tm-nav-link:hover,.tm-nav-home:hover { background:#f5f1ff; color:#633bc1; }
.tm-nav-button { border:1px solid #e8e3ef; color:#625a70; }
.tm-nav-button:hover { border-color:#cfc0f2; color:#633bc1; }
.tm-nav-cta { background:#7046d3; color:white; }
.tm-nav-cta:hover { background:#5931b8; }
.tm-footer { border-top:1px solid #eeeaf4; background:#fff; }
.tm-footer-inner { width:min(100%,80rem); margin:auto; padding:2rem clamp(1rem,3vw,2rem); display:flex; justify-content:space-between; align-items:flex-start; gap:2rem; }
.tm-footer-brand { color:#211936; font-weight:850; font-size:1.05rem; }
.tm-footer-inner p { margin-top:.35rem; color:#746d80; font-size:.82rem; }
.tm-footer-inner small { display:block; margin-top:.8rem; color:#9b95a5; font-size:.72rem; }
.tm-footer-links { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.6rem 1.15rem; }
.tm-footer-links a,.tm-link-pending { color:#625a70; font-size:.78rem; font-weight:650; }
.tm-footer-links a:hover { color:#7046d3; }
.tm-link-pending { color:#9b95a5; }
.tm-draft-tag { margin-left:.2rem; color:#8a6ad1; font-size:.65rem; text-transform:uppercase; letter-spacing:.04em; }
.tm-legal-page { min-height:70vh; padding:clamp(2rem,6vw,5rem) 1rem; background:radial-gradient(ellipse at 85% 0%,#f0eaff,transparent 34rem),#faf9fc; }
.tm-legal-card { width:min(100%,48rem); margin:auto; padding:clamp(1.3rem,4vw,2.5rem); border:1px solid #ece7f4; border-radius:1.35rem; background:white; box-shadow:0 12px 36px #251b3b0b; }
.tm-legal-card h1 { margin:.6rem 0 1.2rem; color:#211936; font-size:clamp(2rem,5vw,2.8rem); font-weight:800; letter-spacing:-.045em; }
.tm-legal-card h2 { margin:1.5rem 0 .35rem; color:#302642; font-size:1.05rem; font-weight:750; }
.tm-legal-card p { color:#706b80; font-size:.92rem; line-height:1.8; }
.tm-legal-warning { padding:1rem; border:1px solid #f0d9a8; border-radius:.85rem; background:#fff9eb; color:#815a16 !important; }
.tm-legal-card a:not(.tm-legal-back) { color:#6840ce; text-decoration:underline; }
.tm-legal-back { display:inline-flex; margin-top:2rem; color:#6840ce; font-weight:700; }
.dashboard-page,.dashboard-shell,.dashboard-feature,.timeline-card,.stat-card { min-width:0; }
.dashboard-page { overflow:clip; }
.dashboard-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.living-editor { transition:box-shadow .25s ease; }
.living-editor:focus-within::before { opacity:.9; filter:blur(15px); }
@media(max-width:760px) {
 .tm-footer-inner { flex-direction:column; gap:1.25rem; }
 .tm-footer-links { justify-content:flex-start; }
}
@media(max-width:560px) {
 .tm-nav { min-height:4.1rem; padding-inline:.85rem; }
 .tm-brand { gap:.5rem; font-size:.98rem; }
 .tm-brand-mark { width:2.25rem; border-radius:.72rem; }
 .tm-nav-actions { gap:.3rem; }
 .tm-nav-link,.tm-nav-home,.tm-nav-button,.tm-nav-cta { min-height:2.45rem; padding:.55rem .65rem; font-size:.74rem; }
 .tm-footer-inner { padding-block:1.5rem; }
 .tm-footer-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:.8rem; }
 .dashboard-stats { grid-template-columns:1fr; }
 .stat-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
 .stat-card .stat-note { grid-column:1/-1; }
 .dashboard-feature { grid-template-columns:1fr; }
 .feature-mark { width:2.7rem; }
 .feature-secondary,.feature-actions { grid-column:auto; width:100%; }
 .feature-actions a { width:100%; justify-content:center; }
 .timeline-list { padding-left:1rem; }
 .timeline-dot { left:-1rem; }
 .timeline-card { gap:.75rem; }
 .living-editor textarea { min-height:16rem; max-height:65vh; }
}
@media(max-width:360px) {
 .tm-brand { font-size:.9rem; }
 .tm-nav-home { padding-inline:.5rem; }
 .tm-nav-button { font-size:.7rem; }
}

.dashboard-resources { display:grid; grid-template-columns:minmax(0,1fr) minmax(15rem,.8fr); gap:2rem; margin-top:2rem; padding:clamp(1.2rem,3vw,1.8rem); border:1px solid #eae5f2; border-radius:1.2rem; background:#fff; }
.dashboard-resources h2 { margin-top:.35rem; color:#251b3b; font-size:1.15rem; font-weight:800; }
.dashboard-resources p:not(.eyebrow) { max-width:36rem; margin-top:.45rem; color:#777187; font-size:.84rem; line-height:1.7; }
.dashboard-resource-links { display:grid; align-content:center; gap:.35rem; }
.dashboard-resource-links a,.resource-pending { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.7rem .8rem; border-radius:.7rem; color:#5f478f; font-size:.82rem; font-weight:700; }
.dashboard-resource-links a:hover { background:#f6f2ff; color:#5630b8; }
.resource-pending { color:#9992a3; font-weight:600; }
@media(max-width:620px) { .dashboard-resources { grid-template-columns:1fr; gap:1rem; } }


/* Landing page responsive refinement */
.tm-landing-hero { overflow:hidden; }
.tm-landing-hero .landing-grid { width:min(100%,80rem); margin-inline:auto; }
.tm-landing-hero h1 { max-width:14ch; text-wrap:balance; overflow-wrap:normal; }
.tm-landing-hero p { overflow-wrap:break-word; }
.tm-landing-preview { min-width:0; width:100%; }
.tm-landing-preview article { min-width:0; }
.tm-landing-preview .preview-body { overflow-wrap:anywhere; }
.tm-landing-steps { min-width:0; }
.tm-landing-steps article { min-width:0; }
@media(max-width:1023px) {
 .tm-landing-hero .landing-grid { grid-template-columns:minmax(0,1fr); gap:2.5rem; padding-top:3.5rem; padding-bottom:4rem; }
 .tm-landing-hero .landing-copy { max-width:44rem; margin-inline:auto; text-align:center; }
 .tm-landing-hero .landing-copy h1 { margin-inline:auto; font-size:clamp(2.35rem,7vw,4rem); }
 .tm-landing-hero .landing-copy > p { margin-inline:auto; }
 .tm-landing-hero .landing-actions,.tm-landing-hero .landing-trust { justify-content:center; }
 .tm-landing-preview { max-width:37rem; margin-inline:auto; }
}
@media(max-width:640px) {
 .tm-landing-hero .landing-grid { gap:2rem; padding:2.5rem 1rem 3rem; }
 .tm-landing-hero .landing-copy h1 { margin-top:1.25rem; font-size:clamp(2.05rem,9vw,3rem); line-height:1.08; letter-spacing:-.045em; }
 .tm-landing-hero .landing-copy > p { margin-top:1rem; font-size:.96rem; line-height:1.75; }
 .tm-landing-hero .landing-actions { display:grid; grid-template-columns:1fr; width:100%; gap:.65rem; margin-top:1.5rem; }
 .tm-landing-hero .landing-actions a { width:100%; min-height:3rem; padding-inline:1rem; }
 .tm-landing-hero .landing-trust { display:grid; justify-items:center; gap:.65rem; margin-top:1.35rem; }
 .tm-landing-preview article { border-radius:1.15rem; }
 .tm-landing-preview .preview-head { padding:1rem; }
 .tm-landing-preview .preview-body { padding:1.2rem; }
 .tm-landing-preview .preview-body h2 { font-size:1.45rem; }
 .tm-landing-preview .preview-foot { align-items:flex-start; padding:.85rem 1rem; }
 .tm-landing-preview .preview-foot > span:first-child { max-width:75%; }
 #como-funciona { scroll-margin-top:1rem; }
 #como-funciona > div { padding:3.25rem 1rem; }
 #como-funciona h2 { font-size:clamp(1.75rem,7vw,2.35rem); line-height:1.15; }
 .tm-landing-steps { margin-top:2rem; gap:.85rem; }
 .tm-landing-steps article { padding:1.25rem; }
}
@media(max-width:380px) {
 .tm-landing-hero .landing-copy h1 { font-size:2rem; }
 .tm-landing-hero .landing-copy .landing-pill { max-width:100%; white-space:normal; text-align:center; }
 .tm-landing-preview .preview-head { gap:.6rem; }
 .tm-landing-preview .preview-head .preview-example { padding:.3rem .55rem; font-size:.65rem; }
 .tm-landing-preview .preview-body { padding:1rem; }
 .tm-landing-preview .preview-body p { font-size:.84rem; line-height:1.7; }
}

.dashboard-primary-action--locked { background:#e9e5f1; color:#5f566e; box-shadow:none; cursor:default; }
.dashboard-primary-action--locked:hover { transform:none; background:#e9e5f1; box-shadow:none; }
.feature-secondary--static { display:inline-flex; align-items:center; justify-content:center; padding:.75rem 1rem; border-radius:.85rem; background:rgb(255 255 255 / 14%); color:white; font-size:.82rem; font-weight:750; text-align:center; }
