/* Pinpoint — styled after embryo.com: DM Sans, black frame, signal red, pill buttons. */
:root {
    --black: #060003;
    --white: #fff;
    --red: #E12309;
    --red-light: #F64027;
    --sky: #83C3DC;
    --grey: #E0E5E9;
    --grey-2: #b1b1b1;
    --grey-3: #383838;
    --muted: #6b6b70;
    --ok: #28a745;
    --warn: #ffb400;
    --radius: 24px;
    --ease: cubic-bezier(.42, 0, .58, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--black);
    color: var(--black);
    font: 400 15px/1.5 "DM Sans", sans-serif;
    letter-spacing: -0.03em;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(32px, 4vw, 52px); }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75em; }

.frame { min-height: 100vh; padding: 8px; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
    display: flex; align-items: center; gap: 32px;
    padding: 0 16px 8px; color: var(--white);
}
.logo { display: block; }
.logo img, img.logo { height: 48px; width: auto; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
    text-decoration: none; padding: 8px 16px; border-radius: 99px; font-size: 15px;
    transition: background .2s var(--ease);
}
.topbar nav a:hover { background: var(--grey-3); }
.topbar nav a.active { background: var(--white); color: var(--black); }
.who { display: flex; align-items: center; gap: 12px; margin: 0; }

.avatar {
    display: inline-grid; place-items: center; flex: none; align-self: flex-start;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--sky); color: var(--black); font-weight: 600; font-size: 13px; text-transform: uppercase;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.guest { background: var(--grey); color: var(--muted); }

/* Main white canvas with the Embryo rounded frame */
.canvas {
    flex: 1; background: var(--white); border-radius: var(--radius);
    padding: clamp(16px, 3vw, 40px); min-width: 0;
}

/* Buttons: pills, arrow on primary */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 1px solid transparent; border-radius: 99px; cursor: pointer;
    font: 600 15px/1 "DM Sans", sans-serif; letter-spacing: -0.03em;
    padding: 12px 22px; text-decoration: none; white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary::after { content: "\2192"; font-weight: 400; transition: transform .2s var(--ease); }
.btn-primary:hover { background: var(--red-light); }
.btn-primary:hover::after { transform: translateX(3px); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--grey-3); }
.btn-outline { border-color: var(--black); background: transparent; color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-ghost-dark { border-color: var(--white); background: transparent; color: var(--white); padding: 9px 16px; font-weight: 400; }
.btn-ghost-dark:hover { background: var(--white); color: var(--black); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--red); cursor: pointer; font: inherit; text-decoration: underline; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 2px solid var(--red); outline-offset: 2px;
}

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=search], select, textarea {
    width: 100%; font: 400 15px/1.4 "DM Sans", sans-serif; letter-spacing: -0.02em; color: var(--black);
    background: var(--white); border: 1px solid var(--grey); border-radius: 14px; padding: 10px 14px;
    transition: border-color .2s var(--ease);
}
select { appearance: none; padding-right: 34px; cursor: pointer;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23060003' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; }
input:hover, select:hover, textarea:hover { border-color: var(--grey-2); }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.flash {
    background: var(--black); color: var(--white); border-radius: 99px; padding: 12px 22px;
    margin-bottom: 24px; width: fit-content;
}
.flash-error { background: var(--red); }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.eyebrow { font-size: 14px; color: var(--muted); margin-bottom: 8px; }

/* Segmented toggle (Kanban / List) */
.seg { display: inline-flex; background: var(--grey); border-radius: 99px; padding: 4px; }
.seg a { padding: 8px 18px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: 14px; }
.seg a.on { background: var(--black); color: var(--white); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 130px; border-radius: 99px; padding: 8px 14px; font-size: 14px; background-color: var(--white); }
.filters select { padding-right: 32px; }
.filters input[type=search] { min-width: 200px; flex: 1; max-width: 320px; }
.filters .clear { font-size: 14px; color: var(--muted); }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--grey); border-radius: 20px; padding: 12px; min-height: 200px; display: flex; flex-direction: column; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; font-weight: 600; }
.col-head .count { background: var(--white); border-radius: 99px; padding: 1px 10px; font-size: 13px; }
.col-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.card {
    background: var(--white); border-radius: 16px; padding: 14px; text-decoration: none; display: block;
    border: 1px solid transparent; cursor: grab; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--black); }
.card.sortable-ghost { opacity: .35; }
.card.sortable-drag { transform: rotate(2deg); }
.card-title { font-weight: 600; line-height: 1.25; margin: 6px 0 10px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.card-meta .spacer { flex: 1; }
.card-thumb { border-radius: 10px; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; width: 100%; margin-bottom: 4px; background: var(--grey); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.s-new { background: #fde4e0; color: #a3200b; }
.s-in_progress { background: #dcefF7; color: #1f6a87; }
.s-review { background: #fff1cc; color: #8a6200; }
.s-done { background: #dff3e4; color: #1d7a34; }
.p-low { color: var(--muted); }
.p-normal { color: var(--grey-3); }
.p-high { color: #c25e00; background: #ffe9d6; }
.p-urgent { color: var(--white); background: var(--red); }
.tag { background: var(--black); color: var(--white); }
.tag::before { display: none; }
.due.overdue { color: var(--red); font-weight: 600; }
.id { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

/* List table */
.table-wrap { overflow-x: auto; border: 1px solid var(--grey); border-radius: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 12px 14px; background: #f6f8f9; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--grey); vertical-align: middle; }
tr.row { cursor: pointer; transition: background .15s var(--ease); }
tr.row:hover { background: #f6f8f9; }
td .title { font-weight: 600; text-decoration: none; }
td .url { color: var(--muted); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.empty { text-align: center; padding: 64px 16px; color: var(--muted); }

/* Issue detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.panel { background: var(--grey); border-radius: 20px; padding: 20px; }
.panel + .panel { margin-top: 12px; }
.panel h3 { margin-bottom: 14px; }
.shot { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--grey); margin: 24px 0; }
.shot a { display: block; }
.shot img { width: 100%; }
.shot .pin {
    position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
    background: var(--red); border: 3px solid var(--white); box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.desc { font-size: 16px; white-space: pre-wrap; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; word-break: break-word; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--grey); border-radius: 12px; padding: 6px 10px; font-size: 13px; text-decoration: none; }
.file img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; }

.thread { margin-top: 40px; }
.comment { display: flex; gap: 12px; padding: 18px 0; border-top: 1px solid var(--grey); }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.comment-head strong { font-weight: 600; }
.comment p { white-space: pre-wrap; margin: 0; }
.reply { margin-top: 16px; }
.reply .actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

details.edit summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: inline; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] summary { display: none; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--white); border-radius: 10px; padding: 8px 10px; word-break: break-all; letter-spacing: 0; }
.stats { display: flex; gap: 20px; margin: 12px 0; }
.stats b { font-size: 28px; font-weight: 600; display: block; letter-spacing: -0.04em; }

/* Login */
.login { min-height: calc(100vh - 16px); display: grid; place-items: center; background: var(--black); color: var(--white); border-radius: var(--radius); }
.login form { width: min(380px, 100%); padding: 16px; }
.login .logo { height: 72px; margin-bottom: 32px; }
.login h1 { margin-bottom: 28px; }
.login label { color: var(--white); }
.login input[type=email], .login input[type=password] { background: var(--grey-3); border-color: var(--grey-3); color: var(--white); }

@media (max-width: 900px) {
    .detail { grid-template-columns: 1fr; }
    .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
    .col { scroll-snap-align: start; }
    .topbar { gap: 12px; }
}
@media (max-width: 560px) {
    .frame { padding: 0; }
    .canvas { border-radius: 20px 20px 0 0; }
    .topbar { padding: 8px 12px; }
    .who .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Internal (team-only) notes */
.comment.internal { background: #fff7db; border-top-color: #f3e2a4; margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-radius: 14px; }
.badge.note { background: #ffe9a3; color: #6b4e00; }
.reply.is-internal textarea { background: #fff7db; border-color: #f3e2a4; }
.actions-right { display: inline-flex; align-items: center; gap: 16px; }
.check { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 0; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--black); }

.narrow { max-width: 560px; }
.narrow .panel + .panel { margin-top: 12px; }
.login-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.login a { color: var(--grey-2); }
.login a:hover { color: var(--white); }
.muted-light { color: var(--grey-2); margin-bottom: 24px; }
a.avatar { text-decoration: none; }
.row-edit summary { color: var(--black); text-decoration: underline; }
.row-edit[open] { text-align: left; }
.row-edit-panel { min-width: 280px; padding-top: 8px; }
.row-edit-links { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; letter-spacing: 0; }

/* Breadcrumbs + dashboard */
.crumbs { margin-bottom: 16px; }
.crumbs a { color: inherit; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.dash ol { list-style: none; margin: 0; padding: 0; }
.dash li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--white); }
.dash li:first-child { border-top: 0; }
