:root {
    --ph-bg: #F5F6F3;
    --ph-surface: #FFFFFF;
    --ph-text: #1B1E1A;
    --ph-text-muted: #5C6358;
    /* Darkened from the mockup baseline so small metadata remains WCAG AA. */
    --ph-text-subtle: #6C7369;
    --ph-border: #E6E8E2;
    --ph-border-control: #E0E3DC;
    --ph-primary: #2563EB;
    --ph-primary-strong: #1D4ED8;
    --ph-primary-soft: #E8F0FE;
    --ph-primary-softer: #EEF4FE;
    --ph-code-bg: #141A2E;
    --ph-code-text: #D6E0F5;
    --ph-danger: #B23A2A;
    --ph-danger-soft: #FBECEA;
    --ph-success: #167451;
    --ph-success-soft: #E8F5EF;
    --ph-radius-control: 10px;
    --ph-radius-card: 16px;
    --ph-radius-section: 18px;
    --ph-content-max: 1140px;
    --ph-shadow-hover: 0 14px 34px -18px rgba(37, 99, 235, .35);
    --ph-focus: 0 0 0 3px rgba(37, 99, 235, .22);
    --ph-ease: cubic-bezier(.16, 1, .3, 1);
}

html {
    scroll-padding-top: 92px;
}

.ph-body {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    background: var(--ph-bg);
    color: var(--ph-text);
    font-family: "IBM Plex Sans Thai", Tahoma, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.ph-app {
    display: flex;
    min-height: 100vh;
    min-width: 0;
    flex-direction: column;
}

.ph-app ::selection {
    background: #CFE0FA;
    color: var(--ph-text);
}

.ph-app a {
    color: inherit;
}

.ph-app button,
.ph-app input,
.ph-app textarea,
.ph-app select {
    font: inherit;
}

.ph-app button,
.ph-app select {
    cursor: pointer;
}

.ph-app button:disabled,
.ph-app input:disabled,
.ph-app select:disabled,
.ph-app textarea:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.ph-app textarea {
    resize: vertical;
}

.ph-app [hidden] {
    display: none !important;
}

.ph-app :where(a, button, input, textarea, select, summary):focus-visible {
    outline: 2px solid var(--ph-primary);
    outline-offset: 3px;
}

.ph-app :where(.ph-input, .ph-select):focus-visible {
    border-color: var(--ph-primary);
    box-shadow: var(--ph-focus);
    outline: 0;
}

.ph-container {
    width: min(100%, var(--ph-content-max));
    margin-inline: auto;
    padding-inline: 28px;
}

.ph-main {
    min-width: 0;
    flex: 1;
}

.ph-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ph-skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 12px;
    padding: 10px 15px;
    border-radius: var(--ph-radius-control);
    background: var(--ph-text);
    color: #F8FAF7;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 180ms var(--ph-ease);
}

.ph-skip-link:focus {
    transform: translateY(0);
}

/* Header and footer */
.ph-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid var(--ph-border);
    background: rgba(245, 246, 243, .94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.ph-header__inner {
    display: grid;
    min-height: 66px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 26px;
    padding-block: 10px;
}

.ph-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.ph-brand__mark {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--ph-primary);
    box-shadow: 0 5px 14px -5px rgba(37, 99, 235, .7);
    color: #F8FAFF;
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
}

.ph-brand__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.05;
}

.ph-brand__name {
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.01em;
}

.ph-brand__tagline {
    margin-top: 3px;
    color: var(--ph-text-subtle);
    font-size: 12px;
    letter-spacing: .035em;
    white-space: nowrap;
}

.ph-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
}

.ph-nav__link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ph-text-muted) !important;
    font-size: 15.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 180ms var(--ph-ease), background-color 180ms var(--ph-ease);
}

.ph-nav__link:hover {
    background: rgba(232, 240, 254, .58);
    color: var(--ph-primary) !important;
}

.ph-nav__link.is-active {
    background: var(--ph-primary-soft);
    color: var(--ph-primary) !important;
}

.ph-header__share {
    white-space: nowrap;
}

.ph-footer {
    border-top: 1px solid var(--ph-border);
    background: var(--ph-surface);
}

.ph-footer__inner {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-block: 18px;
}

.ph-footer p {
    margin: 0;
    color: var(--ph-text-subtle);
    font-size: 14.5px;
}

.ph-footer__share {
    color: var(--ph-primary) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ph-flash-stack {
    position: relative;
    z-index: 10;
    display: grid;
    gap: 8px;
    padding-top: 14px;
}

.ph-flash {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 11px;
    background: var(--ph-surface);
    font-size: 14.5px;
}

.ph-flash--success {
    border-color: #A9D7C5;
    background: var(--ph-success-soft);
    color: #155C43;
}

.ph-flash--error {
    border-color: #EDC3BC;
    background: var(--ph-danger-soft);
    color: #762F25;
}

.ph-flash > span {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.ph-flash p {
    margin: 0;
    overflow-wrap: anywhere;
}

.ph-flash button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin: -9px -9px -9px 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: currentColor;
    font-size: 22px;
}

.ph-flash button:hover {
    background: rgba(27, 30, 26, .06);
}

.ph-feedback {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 20px;
    width: min(390px, calc(100vw - 32px));
    padding: 13px 16px;
    border: 1px solid #B8CAF0;
    border-radius: 11px;
    background: var(--ph-surface);
    box-shadow: 0 16px 36px -18px rgba(27, 30, 26, .42);
    color: var(--ph-text);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    opacity: 0;
    overflow-wrap: anywhere;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 180ms var(--ph-ease), transform 180ms var(--ph-ease);
}

.ph-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ph-feedback[data-tone="success"] {
    border-color: #A9D7C5;
    background: var(--ph-success-soft);
    color: #155C43;
}

.ph-feedback[data-tone="error"] {
    border-color: #EDC3BC;
    background: var(--ph-danger-soft);
    color: #762F25;
}

/* Buttons and controls */
.ph-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--ph-radius-control);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: color 180ms var(--ph-ease), background-color 180ms var(--ph-ease), border-color 180ms var(--ph-ease), transform 180ms var(--ph-ease);
}

.ph-button:active:not(:disabled) {
    transform: translateY(1px);
}

.ph-button--primary {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    box-shadow: 0 7px 18px -10px rgba(37, 99, 235, .85);
    color: #F8FAFF !important;
}

.ph-button--primary:hover {
    border-color: var(--ph-primary-strong);
    background: var(--ph-primary-strong);
}

.ph-button--secondary {
    border-color: var(--ph-border-control);
    background: var(--ph-surface);
    color: var(--ph-text-muted) !important;
}

.ph-button--secondary:hover {
    border-color: #C8D3E7;
    color: var(--ph-primary) !important;
}

.ph-button--soft {
    border-color: #C5D8FB;
    background: var(--ph-primary-softer);
    color: var(--ph-primary) !important;
}

.ph-button--soft:hover {
    border-color: #A8C2F4;
    background: var(--ph-primary-soft);
}

.ph-button--quiet {
    border-color: transparent;
    background: transparent;
    color: var(--ph-primary) !important;
}

.ph-button--quiet:hover {
    background: var(--ph-primary-softer);
}

.ph-button--danger {
    border-color: var(--ph-danger);
    background: var(--ph-danger);
    color: #FFF8F6 !important;
}

.ph-button--danger:hover {
    background: #942E22;
}

.ph-button--large {
    min-height: 50px;
    padding-inline: 25px;
    font-size: 16.5px;
}

.ph-button--block {
    width: 100%;
}

.ph-input,
.ph-select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--ph-border-control);
    border-radius: var(--ph-radius-control);
    background: var(--ph-surface);
    color: var(--ph-text);
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 180ms var(--ph-ease), box-shadow 180ms var(--ph-ease);
}

input.ph-input,
.ph-select {
    padding: 10px 13px;
}

textarea.ph-input {
    min-height: 112px;
    padding: 12px 14px;
}

.ph-input::placeholder {
    color: var(--ph-text-subtle);
    opacity: 1;
}

.ph-input--code {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 14px;
}

.ph-field.has-error .ph-input,
.ph-field.has-error .ph-select,
.ph-fieldset.has-error .ph-choice-card,
.ph-upload.has-error .ph-upload__label,
.ph-app [aria-invalid="true"] {
    border-color: var(--ph-danger);
}

/* Hero and library */
.ph-hero {
    border-bottom: 1px solid var(--ph-border);
    background: linear-gradient(180deg, #E9F0FE 0%, var(--ph-bg) 100%);
}

.ph-hero__inner {
    padding-block: 54px 44px;
}

.ph-hero--compact .ph-hero__inner {
    padding-block: 46px 38px;
}

.ph-eyebrow {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 5px 13px;
    border: 1px solid #D4E2FB;
    border-radius: 999px;
    background: var(--ph-surface);
    color: var(--ph-primary);
    font-size: 14px;
    font-weight: 500;
}

.ph-eyebrow > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2B7FFF;
}

.ph-hero h1,
.ph-page-heading h1,
.ph-form-page__header h1,
.ph-detail__header h1,
.ph-success h1,
.ph-unavailable h1 {
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-weight: 500;
    letter-spacing: -.015em;
}

.ph-hero h1 {
    max-width: 760px;
    margin: 0 0 15px;
    font-size: 47px;
    line-height: 1.08;
}

.ph-hero--compact h1 {
    font-size: 40px;
}

.ph-hero__lead {
    max-width: 590px;
    margin: 0 0 26px;
    color: var(--ph-text-muted);
    font-size: 18px;
    line-height: 1.65;
}

.ph-hero--compact .ph-hero__lead {
    margin-bottom: 0;
    font-size: 17.5px;
}

.ph-stats {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
}

.ph-stat {
    display: flex;
    min-width: 132px;
    flex-direction: column-reverse;
    justify-content: center;
    padding-inline: 25px;
}

.ph-stat:first-child {
    padding-left: 0;
}

.ph-stat + .ph-stat {
    border-left: 1px solid #DDE2DA;
}

.ph-stat dt {
    color: var(--ph-text-subtle);
    font-size: 14px;
}

.ph-stat dd {
    margin: 0;
    color: var(--ph-primary);
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-size: 29px;
    font-weight: 500;
    line-height: 1.2;
}

.ph-library,
.ph-ai-library {
    padding-block: 30px 72px;
}

.ph-search-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 21px;
}

.ph-search-row--ai {
    grid-template-columns: minmax(260px, 1fr) 220px auto;
    margin-bottom: 25px;
}

.ph-search-control {
    position: relative;
    min-width: 0;
}

.ph-search-control .ph-input {
    padding-left: 43px;
    padding-right: 55px;
}

.ph-search-control__icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14px;
    fill: none;
    stroke: #929990;
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: translateY(-50%);
    pointer-events: none;
}

.ph-search-control__clear {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 5px 7px;
    color: var(--ph-primary) !important;
    font-size: 13px;
    text-decoration: none;
    transform: translateY(-50%);
}

.ph-sort {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--ph-border-control);
    border-radius: 11px;
    background: var(--ph-surface);
}

.ph-sort__option {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 8px;
    color: var(--ph-text-muted) !important;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.ph-sort__option.is-active {
    background: var(--ph-primary);
    color: #F8FAFF !important;
}

.ph-filter-stack {
    padding-bottom: 21px;
    border-bottom: 1px solid var(--ph-border);
}

.ph-chip-scroller {
    max-width: 100%;
    margin-bottom: 13px;
}

.ph-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ph-chip {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border: 1px solid var(--ph-border-control);
    border-radius: 999px;
    background: var(--ph-surface);
    color: var(--ph-text-muted) !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    transition: color 180ms var(--ph-ease), background-color 180ms var(--ph-ease), border-color 180ms var(--ph-ease);
}

.ph-chip:hover {
    border-color: #BBCBF0;
    color: var(--ph-primary) !important;
}

.ph-chip.is-selected {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    color: #F8FAFF !important;
}

.ph-chip--compact {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 14.5px;
}

.ph-filter-row {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.ph-filter-group {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.ph-filter-group--provider {
    padding-left: 18px;
    border-left: 1px solid var(--ph-border-control);
}

.ph-filter-label {
    flex: 0 0 auto;
    color: var(--ph-text-subtle);
    font-size: 14px;
}

.ph-results-heading {
    display: flex;
    min-height: 55px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-block: 11px;
}

.ph-results-heading h2 {
    margin: 0;
    color: #6C7268;
    font-size: 15.5px;
    font-weight: 400;
}

.ph-results-heading strong {
    color: var(--ph-text);
    font-weight: 700;
}

.ph-results-heading a {
    color: var(--ph-primary) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.ph-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* Cards */
.ph-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 238px;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-card);
    background: var(--ph-surface);
    transition: border-color 190ms var(--ph-ease), box-shadow 190ms var(--ph-ease), transform 190ms var(--ph-ease);
}

.ph-card__topline,
.ph-card__meta,
.ph-ai-card__heading,
.ph-ai-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ph-card__topline {
    margin-bottom: 12px;
}

.ph-card__badges,
.ph-provider-list {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ph-type-badge,
.ph-status-badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.ph-type-badge--prompt {
    background: #E9F0FE;
    color: #2258C7;
}

.ph-type-badge--skill {
    background: #F1ECF7;
    color: #7144AD;
}

.ph-type-badge--gpt {
    background: #FDF0E6;
    color: #A94819;
}

.ph-status-badge--draft {
    border: 1px solid #D8D4C5;
    background: #F7F4E8;
    color: #705E1C;
}

.ph-status-badge--hidden {
    border: 1px solid #E9BDB5;
    background: var(--ph-danger-soft);
    color: var(--ph-danger);
}

.ph-status-badge--published {
    border: 1px solid #A9D7C5;
    background: var(--ph-success-soft);
    color: #155C43;
}

.ph-like-form {
    position: relative;
    z-index: 3;
    margin: 0;
}

.ph-like-button {
    display: inline-flex;
    min-width: 54px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--ph-border);
    border-radius: 999px;
    background: var(--ph-surface);
    color: var(--ph-text-subtle);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 180ms var(--ph-ease), border-color 180ms var(--ph-ease), color 180ms var(--ph-ease), transform 180ms var(--ph-ease);
}

.ph-like-button svg {
    fill: transparent;
    stroke: #B06F68;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: fill 180ms var(--ph-ease), transform 180ms var(--ph-ease);
}

.ph-like-button:hover {
    border-color: #C7D7F7;
    color: var(--ph-primary);
}

.ph-like-button--readonly {
    cursor: default;
}

.ph-like-button--readonly:hover {
    border-color: var(--ph-border);
    color: var(--ph-text-subtle);
}

.ph-like-button--login {
    text-decoration: none;
}

.ph-like-button[aria-pressed="true"] {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    color: #F8FAFF;
}

.ph-like-button[aria-pressed="true"] svg {
    fill: currentColor;
    stroke: currentColor;
}

.ph-like-button.is-pending {
    pointer-events: none;
    opacity: .64;
}

.ph-like-button--large {
    min-height: 44px;
    padding: 8px 15px;
    font-size: 15px;
}

.ph-card__title,
.ph-ai-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.005em;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

.ph-card__link {
    color: var(--ph-text) !important;
    text-decoration: none;
}

.ph-card__link::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
    content: "";
}

.ph-card__link:focus-visible {
    outline: 0;
}

.ph-card:has(.ph-card__link:focus-visible) {
    border-color: var(--ph-primary);
    box-shadow: var(--ph-focus);
}

.ph-card__description {
    display: -webkit-box;
    min-width: 0;
    margin: 8px 0 16px;
    overflow: hidden;
    flex: 1;
    color: #62695F;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ph-card__meta {
    min-width: 0;
}

.ph-card__category {
    min-width: 0;
    overflow: hidden;
    color: var(--ph-text-subtle);
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ph-provider-badge {
    display: inline-flex;
    min-width: 27px;
    height: 23px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.ph-provider-badge--chatgpt {
    background: #E7F3EE;
    color: #0C7150;
}

.ph-provider-badge--claude {
    background: #F6ECE3;
    color: #A94819;
}

.ph-provider-badge--gemini {
    background: #E8EEFB;
    color: #2856BD;
}

.ph-provider-badge--grok {
    background: #ECECEE;
    color: #303038;
}

.ph-provider-badge--copilot {
    background: #E9F2F5;
    color: #216578;
}

.ph-attachment-mark {
    display: inline-flex;
    width: 27px;
    height: 23px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--ph-primary-softer);
    color: var(--ph-primary);
}

.ph-attachment-mark svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ph-card__owner-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 15px -20px -20px;
    padding: 11px 20px;
    border-top: 1px solid var(--ph-border);
    border-radius: 0 0 var(--ph-radius-card) var(--ph-radius-card);
    background: #FAFBF8;
    color: var(--ph-text-subtle);
    font-size: 12.5px;
}

.ph-card__owner-actions a {
    color: var(--ph-primary) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.ph-card__moderation-note {
    color: var(--ph-danger);
    font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
    .ph-card:hover {
        border-color: #C9D6CD;
        box-shadow: var(--ph-shadow-hover);
        transform: translateY(-3px);
    }
}

/* AI ready-made */
.ph-ai-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ph-ai-card {
    min-height: 186px;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
}

.ph-ai-card__avatar {
    display: flex;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #315FB5;
    color: #F7FAFF;
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-size: 24px;
}

.ph-ai-card:nth-child(4n + 2) .ph-ai-card__avatar {
    background: #9B5E3B;
}

.ph-ai-card:nth-child(4n + 3) .ph-ai-card__avatar {
    background: #4C7765;
}

.ph-ai-card:nth-child(4n + 4) .ph-ai-card__avatar {
    background: #785B91;
}

.ph-ai-card__content {
    min-width: 0;
    flex: 1;
}

.ph-ai-card__heading {
    align-items: flex-start;
    margin-bottom: 6px;
}

.ph-ai-card__description {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: #62695F;
    font-size: 15px;
    line-height: 1.58;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ph-ai-card__meta {
    justify-content: flex-start;
    color: var(--ph-text-subtle);
    font-size: 13.5px;
}

/* Pagination and empty states */
.ph-pagination {
    display: grid;
    max-width: 620px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin: 34px auto 0;
}

.ph-pagination__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ph-pagination__control,
.ph-pagination__page {
    display: inline-flex;
    min-width: 42px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid var(--ph-border-control);
    border-radius: 9px;
    background: var(--ph-surface);
    color: var(--ph-text-muted) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.ph-pagination__control:last-child {
    justify-self: end;
}

.ph-pagination__page.is-current {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    color: #F8FAFF !important;
}

.ph-pagination .is-disabled {
    opacity: .48;
}

.ph-pagination__ellipsis {
    color: var(--ph-text-subtle);
}

.ph-empty-state,
.ph-unavailable {
    display: flex;
    min-height: 320px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 52px 20px;
    color: var(--ph-text-muted);
    text-align: center;
}

.ph-empty-state > svg {
    margin-bottom: 15px;
    fill: none;
    stroke: #8FA0BD;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.ph-empty-state h2,
.ph-unavailable h1 {
    margin: 0 0 7px;
    color: var(--ph-text);
    font-size: 21px;
    font-weight: 600;
}

.ph-empty-state p,
.ph-unavailable p {
    max-width: 520px;
    margin: 0 0 20px;
    color: var(--ph-text-subtle);
}

/* Detail */
.ph-detail {
    max-width: 990px;
    padding-top: 25px;
    padding-bottom: 80px;
}

.ph-back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    margin-bottom: 12px;
    color: var(--ph-text-muted) !important;
    font-size: 15.5px;
    font-weight: 500;
    text-decoration: none;
}

.ph-back-link:hover {
    color: var(--ph-primary) !important;
}

.ph-detail__header {
    margin-bottom: 29px;
}

.ph-detail__labels {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--ph-text-subtle);
    font-size: 14.5px;
    flex-wrap: wrap;
}

.ph-detail__header h1 {
    max-width: 760px;
    margin: 0 0 10px;
    font-size: 35px;
    line-height: 1.17;
    overflow-wrap: anywhere;
}

.ph-detail__description {
    max-width: 700px;
    margin: 0;
    color: var(--ph-text-muted);
    font-size: 17.5px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.ph-detail__actions {
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 15px;
    margin-top: 19px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--ph-border);
    flex-wrap: wrap;
}

.ph-detail__providers {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ph-text-subtle);
    font-size: 14px;
    flex-wrap: wrap;
}

.ph-provider-chip {
    display: inline-flex;
    min-height: 29px;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
}

.ph-provider-chip > span {
    font-size: 11px;
}

.ph-detail__status-note {
    margin: 0;
    padding: 8px 12px;
    border-radius: 9px;
    background: #F7F4E8;
    color: #705E1C;
    font-size: 14px;
}

.ph-detail__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    align-items: start;
    gap: 34px;
}

.ph-detail__main {
    min-width: 0;
}

.ph-link-panel,
.ph-prose,
.ph-side-panel {
    border: 1px solid var(--ph-border);
    background: var(--ph-surface);
}

.ph-link-panel {
    margin-bottom: 28px;
    padding: 23px;
    border-radius: var(--ph-radius-card);
}

.ph-link-panel h2,
.ph-side-panel h2,
.ph-how-to h2,
.ph-section-heading h2 {
    margin: 0;
    color: #3A4038;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.ph-external-url {
    margin: 8px 0 16px;
    color: var(--ph-primary);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 13.5px;
    overflow-wrap: anywhere;
}

.ph-inline-notice {
    margin: 11px 0 0;
    padding: 10px 12px;
    border: 1px solid #E8D8B1;
    border-radius: 9px;
    background: #FAF6E9;
    color: #6F5B1F;
    font-size: 14px;
    line-height: 1.5;
}

.ph-prompt-section {
    margin-bottom: 28px;
}

.ph-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 9px;
}

.ph-button--copy {
    min-height: 44px;
    padding: 7px 13px;
    border-color: #C5D8FB;
    background: var(--ph-surface);
    color: var(--ph-primary) !important;
    font-size: 14.5px;
}

.ph-button--copy svg,
.ph-upload__label svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ph-button--copy.is-copied {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    color: #F8FAFF !important;
}

.ph-code-block {
    max-height: 500px;
    margin: 0;
    padding: 22px;
    overflow: auto;
    border-radius: 14px;
    background: var(--ph-code-bg);
    color: var(--ph-code-text);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 14px;
    line-height: 1.75;
    tab-size: 4;
    white-space: pre-wrap;
    word-break: break-word;
}

.ph-code-block code {
    font: inherit;
}

.ph-copy-hint {
    margin: 9px 0 0;
    color: var(--ph-text-subtle);
    font-size: 13px;
}

.ph-how-to h2 {
    margin-bottom: 11px;
}

.ph-prose {
    max-width: 72ch;
    padding: 21px;
    border-radius: var(--ph-radius-card);
    color: #454B43;
    font-size: 16px;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ph-prose.is-empty {
    color: var(--ph-text-subtle);
    font-style: italic;
}

.ph-detail__sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.ph-side-panel {
    min-width: 0;
    padding: 17px;
    border-radius: var(--ph-radius-card);
}

.ph-side-panel h2 {
    margin-bottom: 11px;
    color: var(--ph-text-subtle);
    font-size: 14px;
    font-weight: 500;
}

.ph-file-card__file {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    margin-bottom: 13px;
}

.ph-file-card__icon,
.ph-existing-file__icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--ph-primary-soft);
    color: var(--ph-primary);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 9px;
    font-weight: 600;
}

.ph-file-card__file > div,
.ph-existing-file > div {
    min-width: 0;
    flex: 1;
}

.ph-file-card__file strong,
.ph-existing-file strong {
    display: block;
    overflow: hidden;
    font-size: 14.5px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ph-file-card__file span:not(.ph-file-card__icon),
.ph-existing-file span:not(.ph-existing-file__icon) {
    display: block;
    margin-top: 2px;
    color: var(--ph-text-subtle);
    font-size: 12.5px;
}

.ph-author-card__identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.ph-author-card__avatar {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4D7180;
    color: #F6FBFC;
    font-family: "IBM Plex Sans Thai", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.ph-author-card__identity > div {
    min-width: 0;
}

.ph-author-card__identity > div > strong,
.ph-author-card__identity > div > span {
    display: block;
    overflow-wrap: anywhere;
}

.ph-author-card__identity > div > strong {
    font-size: 15.5px;
}

.ph-author-card__identity > div > span {
    color: var(--ph-text-subtle);
    font-size: 13.5px;
}

.ph-author-card__contact {
    margin: 13px 0 0;
    padding-top: 11px;
    border-top: 1px solid #EEF0EB;
    color: var(--ph-text-muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.ph-author-card__contact span {
    margin-right: 5px;
    color: var(--ph-text-subtle);
}

.ph-owner-panel .ph-button + form,
.ph-owner-panel form + .ph-danger-zone {
    margin-top: 8px;
}

.ph-danger-zone {
    margin-top: 8px;
    border-radius: 9px;
}

.ph-danger-zone summary {
    min-height: 44px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--ph-danger);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    list-style-position: inside;
    cursor: pointer;
}

.ph-danger-zone summary:hover {
    background: var(--ph-danger-soft);
}

.ph-danger-zone__body {
    padding: 11px;
    border: 1px solid #EDCAC4;
    border-radius: 9px;
    background: var(--ph-danger-soft);
}

.ph-danger-zone__body p {
    margin: 0 0 10px;
    color: #733128;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (min-width: 1024px) and (min-height: 720px) {
    .ph-detail__sidebar {
        position: sticky;
        top: 90px;
    }
}

.ph-unavailable > span {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin-bottom: 17px;
    border-radius: 50%;
    background: var(--ph-danger-soft);
    color: var(--ph-danger);
    font-family: Newsreader, "IBM Plex Sans Thai", Tahoma, serif;
    font-size: 32px;
}

/* Form */
.ph-form-page {
    max-width: 816px;
    padding-top: 24px;
    padding-bottom: 88px;
}

.ph-form-page__header {
    margin-bottom: 27px;
}

.ph-form-page__header h1 {
    margin: 0 0 6px;
    font-size: 34px;
    line-height: 1.2;
}

.ph-form-page__header p {
    max-width: 65ch;
    margin: 0;
    color: var(--ph-text-muted);
    font-size: 16.5px;
}

.ph-error-summary {
    margin-bottom: 20px;
    padding: 15px 17px;
    border: 1px solid #EDC3BC;
    border-radius: var(--ph-radius-control);
    background: var(--ph-danger-soft);
    color: #762F25;
}

.ph-error-summary h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.ph-error-summary ul {
    margin: 0;
    padding-left: 21px;
}

.ph-error-summary a {
    color: #762F25 !important;
}

.ph-form-section {
    margin-bottom: 19px;
    padding: 25px;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-section);
    background: var(--ph-surface);
}

.ph-form-section__title {
    margin: 0 0 19px;
    color: var(--ph-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.4;
}

.ph-form-section__intro {
    margin: -11px 0 16px;
    color: var(--ph-text-subtle);
    font-size: 14px;
}

.ph-field,
.ph-fieldset {
    min-width: 0;
    margin: 0 0 18px;
}

.ph-form-section > :last-child {
    margin-bottom: 0;
}

.ph-field label,
.ph-fieldset legend {
    display: block;
    margin: 0 0 6px;
    color: #30352F;
    font-size: 15px;
    font-weight: 600;
}

.ph-field label > span[aria-hidden],
.ph-fieldset legend > span[aria-hidden] {
    color: var(--ph-danger);
}

.ph-field p,
.ph-fieldset > p,
.ph-field-help {
    margin: 6px 0 0;
    color: var(--ph-text-subtle);
    font-size: 13px;
    line-height: 1.5;
}

.ph-field__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ph-field__meta p {
    flex: 1;
}

.ph-field__meta span {
    flex: 0 0 auto;
    margin-top: 6px;
    color: var(--ph-text-subtle);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
}

.ph-field-error,
.ph-field .ph-field-error,
.ph-fieldset .ph-field-error {
    margin-top: 6px;
    color: var(--ph-danger);
    font-size: 13.5px;
    font-weight: 500;
}

.ph-fieldset {
    padding: 0;
    border: 0;
}

.ph-choice-row,
.ph-provider-choices {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ph-choice-card,
.ph-provider-choice {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 !important;
    padding: 8px 14px;
    border: 1px solid var(--ph-border-control);
    border-radius: 10px;
    background: var(--ph-surface);
    color: var(--ph-text-muted) !important;
    cursor: pointer;
}

.ph-choice-card input,
.ph-provider-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ph-choice-card:has(input:focus-visible),
.ph-provider-choice:has(input:focus-visible),
.ph-status-choice:has(input:focus-visible) {
    border-color: var(--ph-primary);
    box-shadow: var(--ph-focus);
}

.ph-choice-card:has(input:checked),
.ph-provider-choice:has(input:checked) {
    border-color: var(--ph-primary);
    background: var(--ph-primary);
    color: #F8FAFF !important;
}

.ph-provider-choice > span {
    display: inline-flex;
    min-width: 25px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(255, 255, 255, .22);
    font-size: 10px;
    font-weight: 700;
}

.ph-provider-choice:not(:has(input:checked)) > span {
    background: var(--ph-primary-softer);
    color: var(--ph-primary);
}

.ph-js .ph-conditional-panel[data-ph-type-panel] {
    display: none;
}

.ph-js .ph-conditional-panel[data-ph-type-panel].is-active {
    display: block;
}

.ph-upload {
    position: relative;
}

.ph-upload__label {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 1.5px dashed #B8CAF0;
    border-radius: 12px;
    background: #F7F9FE;
    color: var(--ph-text-muted);
    text-align: left;
    cursor: pointer;
    transition: border-color 180ms var(--ph-ease), background-color 180ms var(--ph-ease);
}

.ph-upload__label:hover {
    border-color: var(--ph-primary);
    background: var(--ph-primary-softer);
}

.ph-upload__label svg {
    flex: 0 0 auto;
    color: var(--ph-primary);
}

.ph-upload__label span {
    display: flex;
    flex-direction: column;
}

.ph-upload__label strong {
    color: #3C443A;
    font-size: 15px;
}

.ph-upload__label small {
    color: var(--ph-text-subtle);
    font-size: 12.5px;
}

.ph-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ph-upload:focus-within .ph-upload__label {
    border-color: var(--ph-primary);
    box-shadow: var(--ph-focus);
}

.ph-upload__selection,
.ph-existing-file {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 13px;
    border: 1px solid #C5D8FB;
    border-radius: 11px;
    background: var(--ph-primary-softer);
}

.ph-upload__selection > span {
    min-width: 0;
    overflow: hidden;
    flex: 1;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ph-upload__selection button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ph-text-subtle);
    font-size: 24px;
}

.ph-existing-file {
    margin: 0 0 10px;
}

.ph-remove-file {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    color: var(--ph-danger) !important;
    font-size: 13px !important;
    cursor: pointer;
}

.ph-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ph-status-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ph-status-choice {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--ph-border-control);
    border-radius: 11px;
    cursor: pointer;
}

.ph-status-choice:has(input:checked) {
    border-color: var(--ph-primary);
    background: var(--ph-primary-softer);
}

.ph-status-choice input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--ph-primary);
}

.ph-status-choice span,
.ph-status-choice strong,
.ph-status-choice small {
    display: block;
}

.ph-status-choice strong {
    color: var(--ph-text);
    font-size: 14.5px;
}

.ph-status-choice small {
    margin-top: 2px;
    color: var(--ph-text-subtle);
    font-size: 12.5px;
    line-height: 1.4;
}

.ph-form-actions {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-top: 5px;
}

/* Mine and success */
.ph-mine {
    padding-top: 43px;
    padding-bottom: 78px;
}

.ph-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 28px;
}

.ph-page-kicker {
    margin: 0 0 4px;
    color: var(--ph-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ph-page-heading h1 {
    margin: 0 0 3px;
    font-size: 38px;
    line-height: 1.2;
}

.ph-page-heading p:not(.ph-page-kicker) {
    margin: 0;
    color: var(--ph-text-muted);
}

.ph-mine__filters {
    grid-template-columns: minmax(240px, 1fr) 190px auto;
    margin-bottom: 8px;
    padding: 16px;
    border: 1px solid var(--ph-border);
    border-radius: 14px;
    background: var(--ph-surface);
}

.ph-coming-soon {
    display: grid;
    min-height: calc(100vh - 140px);
    min-height: calc(100svh - 140px);
    place-items: center;
    padding-block: 48px;
}

.ph-coming-soon__inner {
    display: flex;
    width: 100%;
    max-width: 640px;
    align-items: center;
    flex-direction: column;
    margin-inline: auto;
    padding-block: 64px;
    text-align: center;
}

.ph-coming-soon__icon {
    display: inline-flex;
    width: 80px;
    height: 80px;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    border: 1px solid #D8E5FA;
    border-radius: 50%;
    background: var(--ph-primary-soft);
    box-shadow: 0 16px 34px -24px rgba(37, 99, 235, .72);
    color: var(--ph-primary);
}

.ph-coming-soon__icon svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.ph-coming-soon .ph-page-kicker {
    margin: 0 0 12px;
}

.ph-coming-soon h1 {
    margin: 0 0 12px;
    font-size: 42px;
    line-height: 1.15;
}

.ph-coming-soon__message {
    max-width: 52ch;
    margin: 0 0 26px;
    color: var(--ph-text-muted);
    font-size: 17px;
    line-height: 1.7;
}

.ph-coming-soon__action {
    gap: 8px;
}

.ph-success {
    display: flex;
    max-width: 580px;
    min-height: 590px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding-block: 75px;
    text-align: center;
}

.ph-success__icon {
    display: flex;
    width: 78px;
    height: 78px;
    align-items: center;
    justify-content: center;
    margin-bottom: 19px;
    border-radius: 50%;
    background: var(--ph-primary-soft);
    color: var(--ph-primary);
    font-size: 38px;
}

.ph-success h1 {
    margin: 0 0 9px;
    font-size: 33px;
}

.ph-success > p:not(.ph-page-kicker) {
    max-width: 520px;
    margin: 0 0 26px;
    color: var(--ph-text-muted);
    font-size: 17px;
}

.ph-success__actions {
    display: flex;
    justify-content: center;
    gap: 11px;
}

.ph-success__detail-link {
    margin-top: 18px;
    color: var(--ph-primary) !important;
    font-size: 14px;
    font-weight: 600;
}

/* Permission-guarded moderation workspace */
.ph-header__inner--admin {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.ph-admin-badge {
    justify-self: start;
    padding: 4px 9px;
    border: 1px solid #C5D8FB;
    border-radius: 8px;
    background: var(--ph-primary-softer);
    color: var(--ph-primary-strong);
    font-size: 13px;
    font-weight: 700;
}

.ph-admin-index-link__short {
    display: none;
}

.ph-moderation,
.ph-moderation-detail {
    padding-top: 38px;
    padding-bottom: 64px;
}

.ph-moderation__filters {
    grid-template-columns: minmax(0, 1fr) 220px auto;
    padding: 14px;
    border: 1px solid var(--ph-border);
    border-radius: 13px;
    background: var(--ph-surface);
}

.ph-moderation-list {
    display: grid;
    gap: 12px;
}

.ph-moderation-row {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-card);
    background: var(--ph-surface);
}

.ph-moderation-row__status {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    flex-wrap: wrap;
}

.ph-moderation-row__content {
    min-width: 0;
}

.ph-moderation-row__content h2 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.4;
}

.ph-moderation-row__content h2 a {
    text-decoration: none;
}

.ph-moderation-row__content p {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    color: var(--ph-text-muted);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ph-moderation-row__content > span {
    color: var(--ph-text-subtle);
    font-size: 13px;
}

.ph-moderation-action > p,
.ph-file-card > p {
    color: var(--ph-text-muted);
    font-size: 14px;
    line-height: 1.55;
}

/* Tablet */
@media (max-width: 1023px) {
    .ph-header__inner {
        gap: 17px;
    }

    .ph-nav__link {
        padding-inline: 11px;
    }

    .ph-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ph-filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .ph-filter-group--provider {
        padding-left: 0;
        border-left: 0;
    }

    .ph-detail {
        max-width: 820px;
    }

    .ph-detail__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ph-detail__sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .ph-owner-panel {
        grid-column: 1 / -1;
    }

    .ph-moderation-row {
        grid-template-columns: 120px minmax(0, 1fr) auto;
    }
}

/* Mobile */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 128px;
    }

    .ph-container {
        padding-inline: 16px;
    }

    .ph-header__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding-block: 9px 8px;
    }

    .ph-brand__mark {
        width: 34px;
        height: 34px;
    }

    .ph-brand__name {
        font-size: 20px;
    }

    .ph-header__share {
        min-height: 44px;
        padding-inline: 13px;
        font-size: 14px;
    }

    .ph-nav {
        grid-column: 1 / -1;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .ph-nav::-webkit-scrollbar {
        display: none;
    }

    .ph-nav__link {
        min-height: 44px;
        flex: 1 0 auto;
        justify-content: center;
        padding: 7px 12px;
        font-size: 14.5px;
    }

    .ph-coming-soon__inner {
        padding-block: 42px;
    }

    .ph-coming-soon__icon {
        width: 70px;
        height: 70px;
    }

    .ph-coming-soon__icon svg {
        width: 34px;
        height: 34px;
    }

    .ph-coming-soon h1 {
        font-size: 32px;
    }

    .ph-hero__inner,
    .ph-hero--compact .ph-hero__inner {
        padding-block: 36px 33px;
    }

    .ph-eyebrow {
        margin-bottom: 16px;
    }

    .ph-hero h1,
    .ph-hero--compact h1 {
        margin-bottom: 12px;
        font-size: 36px;
        line-height: 1.12;
    }

    .ph-desktop-break {
        display: none;
    }

    .ph-hero__lead,
    .ph-hero--compact .ph-hero__lead {
        font-size: 16.5px;
    }

    .ph-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .ph-stat {
        min-width: 0;
        padding-inline: 12px;
    }

    .ph-stat:first-child {
        padding-left: 0;
    }

    .ph-stat dd {
        font-size: 25px;
    }

    .ph-stat dt {
        font-size: 12px;
    }

    .ph-library,
    .ph-ai-library {
        padding-block: 22px 52px;
    }

    .ph-search-row,
    .ph-search-row--ai,
    .ph-mine__filters,
    .ph-moderation__filters {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 9px;
    }

    .ph-search-control {
        grid-column: 1 / -1;
    }

    .ph-sort {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        order: 3;
    }

    .ph-sort__option {
        min-height: 44px;
        flex: 1;
    }

    .ph-search-submit {
        display: none;
    }

    .ph-search-row--ai .ph-ai-provider,
    .ph-mine__filters .ph-select {
        min-width: 0;
    }

    .ph-chip-scroller {
        margin-inline: -16px;
        padding-inline: 16px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .ph-chip-scroller .ph-chip-row {
        width: max-content;
        max-width: none;
        padding-bottom: 3px;
        flex-wrap: nowrap;
    }

    .ph-chip {
        min-height: 44px;
    }

    .ph-filter-group {
        display: block;
        width: 100%;
    }

    .ph-filter-label {
        display: block;
        margin-bottom: 7px;
    }

    .ph-filter-group .ph-chip-row {
        gap: 7px;
    }

    .ph-chip--compact {
        min-height: 44px;
    }

    .ph-results-heading {
        min-height: 52px;
    }

    .ph-library-grid,
    .ph-ai-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ph-card {
        min-height: 220px;
    }

    .ph-ai-card {
        min-height: 0;
    }

    .ph-pagination {
        gap: 8px;
    }

    .ph-pagination__pages .ph-pagination__page:not(.is-current),
    .ph-pagination__ellipsis {
        display: none;
    }

    .ph-pagination__control {
        padding-inline: 9px;
    }

    .ph-detail {
        padding-top: 16px;
        padding-bottom: 56px;
    }

    .ph-detail__header h1 {
        font-size: 31px;
    }

    .ph-detail__description {
        font-size: 16.5px;
    }

    .ph-detail__actions,
    .ph-detail__providers {
        align-items: flex-start;
    }

    .ph-detail__providers {
        width: 100%;
        flex-direction: column;
    }

    .ph-detail__layout {
        gap: 26px;
    }

    .ph-detail__sidebar {
        display: flex;
    }

    .ph-section-heading {
        align-items: flex-start;
    }

    .ph-code-block {
        max-height: 430px;
        padding: 17px;
        font-size: 13px;
    }

    .ph-form-page {
        padding-top: 16px;
        padding-bottom: 60px;
    }

    .ph-form-page__header h1 {
        font-size: 31px;
    }

    .ph-form-section {
        padding: 19px 16px;
        border-radius: 15px;
    }

    .ph-field-grid,
    .ph-status-choices {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .ph-status-choices {
        gap: 9px;
    }

    .ph-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ph-form-actions .ph-button {
        width: 100%;
    }

    .ph-page-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .ph-page-heading h1 {
        font-size: 34px;
    }

    .ph-page-heading .ph-button {
        align-self: flex-start;
    }

    .ph-mine {
        padding-top: 32px;
        padding-bottom: 56px;
    }

    .ph-mine__filters {
        padding: 12px;
    }

    .ph-moderation,
    .ph-moderation-detail {
        padding-top: 28px;
        padding-bottom: 56px;
    }

    .ph-header__inner--admin {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ph-admin-badge {
        display: none;
    }

    .ph-moderation__filters .ph-select,
    .ph-moderation__filters .ph-button {
        min-width: 0;
    }

    .ph-moderation-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .ph-moderation-row > .ph-button {
        justify-self: stretch;
    }

    .ph-feedback {
        right: 16px;
        bottom: 16px;
    }

    .ph-success {
        min-height: 520px;
        padding-block: 58px;
    }

    .ph-success h1 {
        font-size: 31px;
    }

    .ph-success__actions {
        width: 100%;
        flex-direction: column;
    }

    .ph-footer__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 390px) {
    .ph-brand__tagline {
        display: none;
    }

    .ph-header__share span:first-child {
        display: none;
    }

    .ph-admin-index-link {
        padding-inline: 11px;
    }

    .ph-admin-index-link__full {
        display: none;
    }

    .ph-admin-index-link__short {
        display: inline;
    }

    .ph-hero h1,
    .ph-hero--compact h1 {
        font-size: 32px;
    }

    .ph-stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .ph-stat {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 7px 0;
    }

    .ph-stat + .ph-stat {
        border-top: 1px solid #DDE2DA;
        border-left: 0;
    }

    .ph-stat dt {
        grid-column: 1;
        grid-row: 1;
    }

    .ph-stat dd {
        grid-column: 2;
        grid-row: 1;
        font-size: 24px;
    }

    .ph-ai-card {
        gap: 12px;
        padding: 17px;
    }

    .ph-ai-card__avatar {
        width: 44px;
        height: 44px;
        font-size: 21px;
    }

    .ph-ai-card__heading {
        flex-direction: column;
    }

    .ph-ai-card__heading .ph-like-form {
        align-self: flex-start;
    }

    .ph-upload__label {
        align-items: flex-start;
        flex-direction: column;
    }

    .ph-existing-file {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .ph-remove-file {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ph-app *,
    .ph-app *::before,
    .ph-app *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .ph-card:hover,
    .ph-button:active {
        transform: none !important;
    }

    .ph-feedback {
        transition: none !important;
    }
}

@media (forced-colors: active) {
    .ph-button,
    .ph-chip,
    .ph-type-badge,
    .ph-status-badge,
    .ph-like-button,
    .ph-choice-card,
    .ph-provider-choice {
        forced-color-adjust: auto;
    }
}
