/*
 * PropertyAdverts Tickets: what the ticket site needs beyond the PropertyAdverts V3 stylesheet
 * (pa-v3.css). Colour, spacing and radius come from its tokens; every class here starts pt-.
 */

.pt-icon { flex: none; }
.pt-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.pt-skip:focus { left: 8px; }
main:focus { outline: none; }

.pt-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.pt-stack-sm { display: grid; gap: 10px; }
.pt-narrow { max-width: 880px; }
.pt-muted { margin: 0; color: var(--muted); font-size: 14px; }
.pt-link { color: var(--gold-dark); font-weight: 600; text-decoration: none; }
.pt-link:hover { text-decoration: underline; }
.pt-error { margin: 4px 0 0; color: var(--crit); font-size: 13px; font-weight: 600; }
.pt-when { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pt-meta { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.pt-pill--plain { background: var(--navy-soft); color: var(--body); }
.pt-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 8px !important; }
.pt-count { margin-left: 6px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--crit-bg); color: var(--crit); }

/* Messages after a save. */
.pt-toast { margin: 0 0 16px; padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; border: 1px solid transparent; }
.pt-toast--ok { background: var(--ok-bg); color: var(--ok); }
.pt-toast--warn { background: var(--warn-bg); color: var(--warn); }
.pt-toast--crit { background: var(--crit-bg); color: var(--crit); }

/* Whether Claude is on, and when the office computer last checked in. */
.pt-worker { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.pt-worker__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.pt-worker--on .pt-worker__dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.pt-worker--silent .pt-worker__dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

/* The account fly-out: the app download and sign out. */
.v3-acct .pt-menu-button {
    appearance: none; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; width: 100%; text-align: left;
    display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px;
}
.v3-acct .pt-menu-button:hover { background: var(--navy-soft); }
.v3-acct .pt-menu-button strong { font-size: 14px; font-weight: 600; }
.v3-acct a { align-items: center; }
.pt-app { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px 4px; }
.pt-app__copy { display: grid; gap: 2px; min-width: 0; }
.pt-app__copy strong { font-size: 14px; font-weight: 600; }
.pt-app__copy small { color: var(--muted); font-size: 12.5px; }
.pt-app__installed:empty { display: none; }
.pt-app.has-update .v3-btn { box-shadow: 0 0 0 3px var(--gold-soft); }
.pt-install { margin-top: 8px; display: grid; gap: 8px; }
.pt-install .v3-btn { justify-self: start; }
.pt-install__status p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.pt-install__track { display: block; height: 6px; border-radius: 999px; background: var(--navy-soft); overflow: hidden; }
.pt-install__track span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.pt-install.is-indeterminate .pt-install__track span { width: 35%; animation: pt-slide 1.2s ease-in-out infinite; }
.pt-install.is-settled .pt-install__track { display: none; }
@keyframes pt-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* The fly-out on a phone sits under the bar, full width. */
@media (max-width: 899px) {
    .v3-flyout.is-phone { left: 8px !important; right: 8px !important; width: auto; min-width: 0; }
}

/* The "For you" call-out on the desk. */
.pt-callout-link { display: grid; gap: 2px; margin-bottom: 14px; text-decoration: none; }
.pt-callout-link strong { font-size: 15px; }

/* Desk filters, inside the list's head. */
.pt-filters { border-bottom: 1px solid var(--line); background: var(--card-soft); align-items: end; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.pt-filters .pt-link { align-self: center; font-size: 13px; }

/* Buttons in a row. */
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-actions form { margin: 0; }
.pt-actions--end { justify-content: flex-end; }
.pt-next__text { margin: 0 0 12px; font-size: 14.5px; }
.pt-next__text:last-child { margin-bottom: 0; }
.pt-next { box-shadow: inset 4px 0 0 var(--gold), var(--shadow-sm); }
.pt-done { box-shadow: inset 4px 0 0 var(--ok), var(--shadow-sm); }
.pt-done .v3-card__ico { background: var(--ok-bg); color: var(--ok); }

/* A line of input and button. */
.pt-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.pt-projects .pt-inline { border-top: 0; padding-block: 6px; }
.pt-projects { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--line); }
.pt-input {
    flex: 1 1 200px; min-width: 0; font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 10px;
    border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); min-height: 40px;
}

/* Checkbox rows: "For you" and the to-dos. */
.pt-check { appearance: none; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px 0 0 -6px; border-radius: 8px; }
.pt-check:hover { color: var(--ink); background: var(--navy-soft); }
.v3-checklist li.is-done strong { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.v3-checklist li.is-done .pt-check { color: var(--ok); }
.v3-checklist small a { color: var(--gold-dark); }
.v3-checklist form { margin: 0; }

/* Type and priority as chips (radio buttons underneath). */
.pt-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pt-fieldset legend { padding: 0; margin-bottom: 6px; }
.pt-choice { position: relative; display: inline-flex; }
.pt-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pt-choice .v3-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.pt-choice input:checked + .v3-chip { background: var(--navy); border-color: var(--navy); color: #fff; }
.pt-choice input:focus-visible + .v3-chip { outline: 3px solid var(--gold); outline-offset: 2px; }
.v3-field small { font-weight: 500; color: var(--muted); }

/* Ticket text, written in Markdown. */
.pt-text { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.pt-text > :first-child { margin-top: 0; }
.pt-text > :last-child { margin-bottom: 0; }
.pt-text p, .pt-text ul, .pt-text ol { margin: 0 0 10px; }
.pt-text ul, .pt-text ol { padding-left: 22px; }
.pt-text a { color: var(--gold-dark); font-weight: 600; }
.pt-text code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; background: var(--navy-soft); padding: 1px 5px; border-radius: 5px; }
.pt-text pre { overflow-x: auto; background: var(--card-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pt-text pre code { background: none; padding: 0; }
.pt-text h1, .pt-text h2, .pt-text h3 { font-size: 15px; margin: 14px 0 6px; }
.pt-pagelink { display: flex; gap: 6px; align-items: center; margin: 12px 0 0; font-size: 13.5px; overflow-wrap: anywhere; min-width: 0; }
.pt-pagelink a { color: var(--gold-dark); font-weight: 600; min-width: 0; }

/* Screenshots on a ticket. */
.pt-gallery { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); }
.pt-gallery__tile {
    display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--line); background: var(--card-soft); text-decoration: none; color: var(--body);
}
.pt-gallery__tile img { width: 100%; height: 100%; object-fit: cover; }
.pt-gallery__tile.is-file { gap: 6px; padding: 10px; text-align: center; font-size: 12px; overflow-wrap: anywhere; }

/* The story: comments, Claude's notes and every change. */
.pt-story { list-style: none; margin: 0; padding: 6px 16px 4px; display: grid; gap: 10px; }
.pt-story__status { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.pt-story__status strong { color: var(--body); }
.pt-story__note { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--card); }
.pt-story__note.is-claude { background: var(--card-soft); }
.pt-story__note.is-question { border-color: var(--warn); background: var(--warn-bg); }
.pt-story__note.is-done { border-color: var(--ok); }
.pt-story__who { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.pt-story__who strong { color: var(--ink); }
.pt-comment { display: grid; gap: 12px; padding: 14px 16px 16px; border-top: 1px solid var(--line); margin-top: 10px; }

/* Adding screenshots. */
.pt-files { gap: 8px; }
.pt-files__label { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.pt-files__native { font: inherit; font-size: 14px; }
.pt-files.is-enhanced .pt-files__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pt-files__grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); }
.pt-files__add {
    appearance: none; cursor: pointer; font: inherit; color: var(--gold-dark);
    border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--card-soft);
    min-height: 96px; display: grid; place-items: center; align-content: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 10px;
}
.pt-files__add.is-compact { min-height: 70px; }
.pt-files__add:hover, .pt-files.is-dragging .pt-files__add { border-color: var(--gold); background: var(--gold-soft); }
.pt-files__tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--card-soft); display: grid; place-items: center; }
.pt-files__tile img { width: 100%; height: 100%; object-fit: cover; }
.pt-files__doc { padding: 8px; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.pt-files__size { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: rgb(8 26 56 / 0.72); color: #fff; padding: 1px 6px; border-radius: 999px; }
.pt-files__remove { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: rgb(8 26 56 / 0.72); color: #fff; display: grid; place-items: center; }
.pt-files__hint { font-size: 12.5px; color: var(--muted); }

/* Send back to Claude: a dialog on a computer, a bottom sheet on a phone. */
.pt-dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
.pt-dialog::backdrop { background: rgb(8 26 56 / 0.5); }
.pt-dialog__frame {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgb(8 26 56 / 0.28);
    width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; display: grid;
}
.pt-dialog__head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 18px 6px; }
.pt-dialog__head h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.pt-dialog__body { display: grid; gap: 12px; padding: 10px 18px; }
.pt-dialog__body textarea { font: inherit; font-size: 14px; width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); resize: vertical; }
.pt-dialog__foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px 18px; border-top: 1px solid var(--line); margin-top: 8px; }
@media (max-width: 599px) {
    .pt-dialog { margin: auto 0 0; width: 100%; }
    .pt-dialog__frame { width: 100%; border-radius: 18px 18px 0 0; max-height: 88dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Sign in. */
.pt-signin-body { padding-bottom: 0; }
.pt-signin { min-height: 100dvh; display: grid; place-content: center; gap: 16px; padding: 24px 16px; width: min(420px, 100%); margin-inline: auto; }
.pt-signin__brand { justify-self: center; font-size: 17px; }
.pt-signin__card h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.pt-signin .v3-field input { min-height: 44px; }
.pt-signin__go { justify-content: center; min-height: 44px; }
.pt-remember { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--body); }
.pt-remember input { width: 18px; height: 18px; }
.pt-signin__foot { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* Touch targets on phones. */
@media (max-width: 899px) {
    .v3-btn { min-height: 44px; }
    .v3-btn--sm { min-height: 38px; }
    .v3-field input, .v3-field select, .v3-field textarea, .pt-input { min-height: 44px; font-size: 16px; }
}

/* The desk tabs are links here, not buttons. */
a.v3-state { text-decoration: none; }

/* On a phone the four filters sit two by two. */
@media (max-width: 599px) {
    .pt-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; }
    .pt-filters .v3-field label { font-size: 12px; }
}

/* A ticket on a phone: one column, with "For you" straight after the work done. */
@media (max-width: 899px) {
    .pt-flow { display: contents; }
    .pt-o1 { order: 1; } .pt-o2 { order: 2; } .pt-o3 { order: 3; } .pt-o4 { order: 4; } .pt-o5 { order: 5; } .pt-o6 { order: 6; }
}

/* A project row keeps its name and both buttons on one line on a phone. */
.pt-projects .pt-input { flex-basis: 110px; }
