:root {
    --iw-gold: #c9a45f;
    --iw-gold-soft: #e0c58d;
    --iw-bg: #080b10;
    --iw-panel: #0f141c;
    --iw-panel-2: #131a24;
    --iw-border: #27313d;
    --iw-text: #f2f4f7;
    --iw-muted: #98a3b2;
    --iw-danger: #db7a78;
}

.iwrite-services-page { background: var(--iw-bg); color: var(--iw-text); }
.iw-services-shell { width: min(1220px, calc(100% - 36px)); margin: 0 auto; padding: 36px 0 72px; }
.iw-services-eyebrow { display: block; color: var(--iw-gold); font-size: 11px; line-height: 1; letter-spacing: .2em; font-weight: 800; text-transform: uppercase; }
.iw-services-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 42px; align-items: end; padding: 54px; border: 1px solid var(--iw-border); border-radius: 28px; background: radial-gradient(circle at 78% 22%, rgba(201,164,95,.16), transparent 34%), linear-gradient(145deg, #111821 0%, #0b1017 68%); box-shadow: 0 26px 80px rgba(0,0,0,.28); }
.iw-services-hero::after { content: "iW"; position: absolute; right: 36px; top: -58px; color: rgba(201,164,95,.035); font: 900 210px/1 Georgia, serif; pointer-events: none; }
.iw-services-hero h1, .iw-form-heading h1, .iw-dashboard-heading h1 { margin: 13px 0 16px; max-width: 820px; font: 700 clamp(34px, 5vw, 64px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.035em; color: #fff; }
.iw-services-hero p, .iw-form-heading p, .iw-dashboard-heading p { margin: 0; max-width: 780px; color: #aeb8c4; font-size: 16px; line-height: 1.7; }
.iw-services-hero__actions, .iw-dashboard-heading__actions, .iw-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.iw-btn { appearance: none; display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .035em; text-decoration: none; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease; }
.iw-btn:hover { transform: translateY(-1px); text-decoration: none; }
.iw-btn--gold { background: var(--iw-gold); color: #101318; border-color: var(--iw-gold); box-shadow: 0 8px 26px rgba(201,164,95,.14); }
.iw-btn--gold:hover { background: var(--iw-gold-soft); color: #0c0f13; }
.iw-btn--ghost { background: #131923; color: #e9edf2; border-color: #313b49; }
.iw-btn--ghost:hover { border-color: #596575; }
.iw-btn--quiet { background: transparent; color: #b9c1cb; border-color: #2a3440; }
.iw-btn--danger-quiet { background: rgba(219,122,120,.08); color: #e6a09e; border-color: rgba(219,122,120,.28); }
.iw-btn--block { width: 100%; }

.iw-services-toolbar { margin: 22px 0 12px; padding: 18px; border: 1px solid #222b35; border-radius: 18px; background: rgba(15,20,28,.92); }
.iw-services-filter { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(180px, .8fr) minmax(180px, .7fr) auto auto; gap: 12px; align-items: end; }
.iw-field { display: flex; flex-direction: column; gap: 8px; color: #aeb8c5; font-size: 12px; font-weight: 700; }
.iw-field > span:first-child { letter-spacing: .025em; }
.iw-field em { color: #6f7c8c; font-style: normal; font-weight: 500; }
.iw-field input, .iw-field select, .iw-field textarea { width: 100%; min-height: 44px; border: 1px solid #2d3744; border-radius: 10px; outline: none; background: #0b1017; color: #eef1f4; padding: 11px 12px; font: 500 14px/1.45 system-ui, sans-serif; transition: border-color .15s ease, box-shadow .15s ease; }
.iw-field textarea { resize: vertical; min-height: 90px; }
.iw-field input:focus, .iw-field select:focus, .iw-field textarea:focus { border-color: #8f7549; box-shadow: 0 0 0 3px rgba(201,164,95,.08); }
.iw-field--wide { grid-column: 1 / -1; }
.iw-field--wide-two { grid-column: span 2; }
.iw-field-error { min-height: 0; color: #df8987; font-size: 11px; font-weight: 600; }

.iw-category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: thin; }
.iw-category-chip { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #27313b; border-radius: 999px; color: #9faab8; background: #0e131a; text-decoration: none; font-size: 12px; font-weight: 700; }
.iw-category-chip:hover, .iw-category-chip.is-active { color: #15191f; border-color: var(--iw-gold); background: var(--iw-gold); text-decoration: none; }

.iw-services-results { padding-top: 34px; }
.iw-section-heading, .iw-dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.iw-section-heading h2 { margin: 7px 0 0; color: #f7f8fa; font: 700 27px/1.15 Georgia, serif; }
.iw-text-link { color: #cdb477; text-decoration: none; font-size: 13px; font-weight: 700; }
.iw-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.iw-service-card { min-width: 0; display: flex; flex-direction: column; padding: 22px; border: 1px solid #242e39; border-radius: 18px; background: linear-gradient(155deg, #111720 0%, #0d1219 100%); box-shadow: 0 14px 36px rgba(0,0,0,.16); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.iw-service-card:hover { transform: translateY(-3px); border-color: #4b4538; box-shadow: 0 20px 48px rgba(0,0,0,.24); }
.iw-service-card__top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.iw-service-category { display: inline-flex; align-items: center; min-height: 26px; width: fit-content; padding: 0 9px; border: 1px solid rgba(201,164,95,.25); border-radius: 999px; background: rgba(201,164,95,.07); color: #d8bd83; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.iw-service-price { display: flex; flex-direction: column; text-align: right; color: #e8edf3; font-size: 13px; font-weight: 800; white-space: nowrap; }
.iw-service-price small { color: #737f8e; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.iw-service-card h3 { margin: 18px 0 9px; font: 700 22px/1.2 Georgia, serif; }
.iw-service-card h3 a { color: #fff; text-decoration: none; }
.iw-service-card > p { margin: 0 0 22px; min-height: 66px; color: #9ca8b6; font-size: 14px; line-height: 1.55; }
.iw-service-card__meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid #202934; }
.iw-service-card__meta > span:nth-child(2), .iw-provider-line > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.iw-service-card__meta small, .iw-provider-line small { color: #6f7c8a; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.iw-service-card__meta strong, .iw-provider-line strong { overflow: hidden; color: #e7ebef; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.iw-provider-avatar { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid #564b35; border-radius: 50%; background: #17191a; color: var(--iw-gold); font: 800 13px/1 Georgia, serif; }
.iw-provider-avatar--large { width: 46px; height: 46px; font-size: 18px; }
.iw-service-delivery { color: #8b97a4; font-size: 11px; }
.iw-service-card__cta { display: flex; justify-content: space-between; margin-top: 16px; color: #d7bf88; text-decoration: none; font-size: 12px; font-weight: 800; }

.iw-empty-state { padding: 36px; border: 1px dashed #34404d; border-radius: 18px; text-align: center; background: #0d1218; }
.iw-empty-state--large { padding: 66px 30px; }
.iw-empty-state strong { color: #f2f4f7; font: 700 22px/1.2 Georgia, serif; }
.iw-empty-state p { margin: 8px auto 18px; max-width: 620px; color: #8f9aa8; line-height: 1.6; }
.iw-alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 11px; font-size: 13px; font-weight: 700; }
.iw-alert--success { border: 1px solid rgba(99,177,139,.28); background: rgba(99,177,139,.08); color: #a7d6bd; }
.iw-alert--error { border: 1px solid rgba(219,122,120,.3); background: rgba(219,122,120,.08); color: #e8a6a4; }

.iw-breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; color: #667280; font-size: 11px; }
.iw-breadcrumb a { color: #a7b1bc; text-decoration: none; }
.iw-service-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.iw-service-detail, .iw-contact-card { border: 1px solid #242e39; border-radius: 22px; background: #0e141c; }
.iw-service-detail { overflow: hidden; }
.iw-service-detail__headline { padding: 34px; background: radial-gradient(circle at 88% 10%, rgba(201,164,95,.12), transparent 28%); }
.iw-service-detail__headline h1 { margin: 14px 0 12px; max-width: 820px; color: #fff; font: 700 clamp(32px, 4.5vw, 53px)/1.04 Georgia, serif; letter-spacing: -.03em; }
.iw-service-lead { margin: 0 0 24px; max-width: 780px; color: #a9b4c0; font-size: 16px; line-height: 1.7; }
.iw-provider-line { display: flex; align-items: center; gap: 11px; }
.iw-detail-section { padding: 30px 34px; border-top: 1px solid #202a34; }
.iw-service-description { margin-top: 14px; color: #c5ccd5; font-size: 15px; line-height: 1.78; white-space: pre-line; }
.iw-detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.iw-detail-facts > div { padding: 15px; border: 1px solid #27313c; border-radius: 12px; background: #0b1016; }
.iw-detail-facts small, .iw-detail-facts strong { display: block; }
.iw-detail-facts small { color: #6f7c89; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; }
.iw-detail-facts strong { margin-top: 4px; color: #dce1e7; font-size: 13px; }
.iw-detail-facts a { color: #d5bb7f; text-decoration: none; }
.iw-contact-card { position: sticky; top: 104px; padding: 24px; }
.iw-contact-card__price { display: flex; flex-direction: column; padding-bottom: 20px; border-bottom: 1px solid #26303b; }
.iw-contact-card__price small { color: #707d8c; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.iw-contact-card__price strong { margin-top: 4px; color: #fff; font: 700 27px/1.1 Georgia, serif; }
.iw-contact-card__intro { padding: 22px 0 14px; }
.iw-contact-card__intro h2 { margin: 9px 0; color: #fff; font: 700 21px/1.2 Georgia, serif; }
.iw-contact-card__intro p, .iw-owner-panel p { margin: 0; color: #8995a3; font-size: 13px; line-height: 1.55; }
.iw-contact-form { display: flex; flex-direction: column; gap: 13px; }
.iw-contact-note { color: #697583; font-size: 10px; line-height: 1.45; text-align: center; }
.iw-owner-panel { display: grid; gap: 11px; padding-top: 20px; }

.iw-form-shell { max-width: 1040px; }
.iw-form-heading { margin-bottom: 26px; }
.iw-form-heading h1, .iw-dashboard-heading h1 { font-size: clamp(34px, 4.5vw, 52px); }
.iw-editor-form { display: grid; gap: 16px; }
.iw-form-card { padding: 25px; border: 1px solid #252f3a; border-radius: 18px; background: #0e141c; }
.iw-form-card--compact { padding: 18px 22px; }
.iw-form-card__title { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.iw-form-card__title > span { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid #55482f; border-radius: 50%; color: #d2b575; font: 800 11px/1 system-ui; }
.iw-form-card__title > div { display: flex; flex-direction: column; }
.iw-form-card__title strong { color: #f1f3f5; font-size: 16px; }
.iw-form-card__title small { margin-top: 2px; color: #788594; font-size: 11px; }
.iw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.iw-form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iw-form-actions { justify-content: flex-end; padding-top: 6px; }
.iw-validation { color: #e09996; font-size: 12px; }
.iw-validation:empty { display: none; }
.iw-switch-row { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.iw-switch-row > input { position: absolute; opacity: 0; pointer-events: none; }
.iw-switch { position: relative; flex: 0 0 auto; width: 44px; height: 24px; border: 1px solid #3a4551; border-radius: 999px; background: #151c25; transition: .18s ease; }
.iw-switch::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: #7d8996; transition: .18s ease; }
.iw-switch-row > input:checked + .iw-switch { border-color: #8d7447; background: rgba(201,164,95,.2); }
.iw-switch-row > input:checked + .iw-switch::after { transform: translateX(20px); background: var(--iw-gold); }
.iw-switch-row > span:last-child { display: flex; flex-direction: column; }
.iw-switch-row strong { color: #e8ebef; font-size: 13px; }
.iw-switch-row small { margin-top: 2px; color: #778391; font-size: 11px; line-height: 1.45; }

.iw-manage-list { display: grid; gap: 12px; }
.iw-manage-card { display: grid; grid-template-columns: 100px minmax(0, 1fr) 150px auto; gap: 18px; align-items: center; padding: 20px; border: 1px solid #242e39; border-radius: 16px; background: #0e141b; }
.iw-manage-card__status { display: flex; align-items: center; gap: 7px; color: #8d99a7; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.iw-manage-card__status > span { width: 7px; height: 7px; border-radius: 50%; background: #6e7782; }
.iw-manage-card__status.is-active { color: #9ac8ad; }
.iw-manage-card__status.is-active > span { background: #6db18a; box-shadow: 0 0 0 4px rgba(109,177,138,.09); }
.iw-manage-card__content h2 { margin: 7px 0 5px; color: #f0f2f4; font: 700 19px/1.2 Georgia, serif; }
.iw-manage-card__content p { margin: 0 0 6px; color: #84909d; font-size: 12px; }
.iw-manage-card__content > small { color: #5f6a76; font-size: 10px; }
.iw-manage-card__price { display: flex; flex-direction: column; text-align: right; }
.iw-manage-card__price small { color: #687482; font-size: 9px; text-transform: uppercase; }
.iw-manage-card__price strong { color: #d9dee5; font-size: 13px; }
.iw-manage-card__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.iw-manage-card__actions form { margin: 0; }

.iw-messages-shell { max-width: 980px; }
.iw-inbox { overflow: hidden; border: 1px solid #26303b; border-radius: 18px; background: #0d131a; }
.iw-thread-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 17px 18px; border-bottom: 1px solid #202934; color: inherit; text-decoration: none; transition: background .15s ease; }
.iw-thread-card:last-child { border-bottom: 0; }
.iw-thread-card:hover { background: #121923; text-decoration: none; }
.iw-thread-card.has-unread { background: linear-gradient(90deg, rgba(201,164,95,.06), transparent 35%); }
.iw-thread-card__main { min-width: 0; display: grid; gap: 3px; }
.iw-thread-card__row { display: flex; justify-content: space-between; gap: 12px; }
.iw-thread-card__row strong { color: #edf0f3; font-size: 13px; }
.iw-thread-card__row time { color: #606c79; font-size: 10px; }
.iw-thread-card__subject { color: #bec6d0; font-size: 12px; font-weight: 700; }
.iw-thread-card__service { color: #b99a5f; font-size: 10px; }
.iw-thread-card__preview { overflow: hidden; color: #778391; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.iw-unread-badge { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 999px; background: var(--iw-gold); color: #11151a; font-size: 10px; font-weight: 900; }
.iw-thread-card__arrow { color: #65717e; }

.iw-conversation-shell { max-width: 940px; }
.iw-conversation-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid #26313c; border-radius: 16px 16px 0 0; background: #101720; }
.iw-conversation-header__meta { display: flex; min-width: 0; flex-direction: column; gap: 3px; color: #aeb7c1; font-size: 12px; }
.iw-conversation-header__meta span:first-child { color: #e2e6eb; font-weight: 700; }
.iw-chat-panel { border: 1px solid #26313c; border-top: 0; border-radius: 0 0 16px 16px; background: #0b1016; }
.iw-chat-history { display: flex; height: min(58vh, 620px); min-height: 360px; flex-direction: column; gap: 12px; overflow-y: auto; padding: 22px; }
.iw-chat-message { width: min(76%, 650px); padding: 12px 14px; border: 1px solid #29333f; border-radius: 15px; background: #131a23; }
.iw-chat-message.is-mine { align-self: flex-end; border-color: rgba(201,164,95,.28); background: #191813; }
.iw-chat-message.is-theirs { align-self: flex-start; }
.iw-chat-message__meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.iw-chat-message__meta strong { color: #cfb57c; font-size: 10px; }
.iw-chat-message__meta time { color: #606d79; font-size: 9px; }
.iw-chat-message__body { color: #d2d8df; font-size: 13px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.iw-read-state { display: block; margin-top: 5px; color: #746d5d; font-size: 9px; text-align: right; }
.iw-chat-compose { padding: 16px; border-top: 1px solid #222c36; background: #0f151d; }
.iw-chat-compose textarea { min-height: 90px; }
.iw-chat-compose__footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 10px; }
.iw-chat-compose__footer small { color: #65717e; font-size: 10px; }
.iw-archive-form { margin-top: 12px; text-align: right; }
.iw-text-button { border: 0; background: transparent; color: #697583; font-size: 11px; cursor: pointer; }
.iw-text-button:hover { color: #c5cbd3; }

.iw-settings-shell { max-width: 920px; }
.iw-settings-card { display: grid; gap: 22px; }
.iw-test-email-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 20px 22px; border: 1px solid #29343f; border-radius: 15px; background: #10161e; }
.iw-test-email-card strong { color: #e6e9ed; }
.iw-test-email-card p { margin: 4px 0 0; color: #7b8794; font-size: 11px; }
.iw-inline-check { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #2d3744; border-radius: 10px; background: #0b1017; color: #c0c7cf; font-size: 12px; }
.iw-inline-check input { width: auto; min-height: 0; }
.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; }

@media (max-width: 980px) {
    .iw-services-hero { grid-template-columns: 1fr; padding: 36px; }
    .iw-services-filter { grid-template-columns: 1fr 1fr; }
    .iw-field--search { grid-column: 1 / -1; }
    .iw-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .iw-service-detail-grid { grid-template-columns: 1fr; }
    .iw-contact-card { position: static; }
    .iw-manage-card { grid-template-columns: 90px minmax(0, 1fr) 130px; }
    .iw-manage-card__actions { grid-column: 1 / -1; }
    .iw-form-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .iw-services-shell { width: min(100% - 20px, 1220px); padding-top: 20px; }
    .iw-services-hero { padding: 28px 22px; border-radius: 20px; }
    .iw-services-hero h1 { font-size: 38px; }
    .iw-services-hero__actions, .iw-dashboard-heading__actions { width: 100%; }
    .iw-services-hero__actions .iw-btn, .iw-dashboard-heading__actions .iw-btn { flex: 1; }
    .iw-services-filter { grid-template-columns: 1fr; }
    .iw-field--search { grid-column: auto; }
    .iw-service-grid { grid-template-columns: 1fr; }
    .iw-section-heading, .iw-dashboard-heading { align-items: stretch; flex-direction: column; }
    .iw-detail-facts, .iw-form-grid, .iw-form-grid--three { grid-template-columns: 1fr; }
    .iw-field--wide-two { grid-column: auto; }
    .iw-service-detail__headline, .iw-detail-section { padding: 23px 20px; }
    .iw-contact-card { padding: 20px; }
    .iw-manage-card { grid-template-columns: 1fr; gap: 12px; }
    .iw-manage-card__price { text-align: left; }
    .iw-manage-card__actions { grid-column: auto; justify-content: flex-start; }
    .iw-thread-card { grid-template-columns: auto minmax(0, 1fr) auto; }
    .iw-thread-card__arrow { display: none; }
    .iw-conversation-header { grid-template-columns: 1fr; }
    .iw-chat-history { min-height: 320px; height: 52vh; padding: 14px; }
    .iw-chat-message { width: 90%; }
    .iw-chat-compose__footer, .iw-test-email-card { align-items: stretch; flex-direction: column; }
    .iw-form-actions { justify-content: stretch; }
    .iw-form-actions .iw-btn { flex: 1; }
}
